Skip to content

Commit

Permalink
[cssom][css-images][css-conditional] Re-up and apply the patch from #473
Browse files Browse the repository at this point in the history
, switching CSS from interface to namespace. Closes #437.
  • Loading branch information
tabatkins committed Apr 20, 2018
1 parent 59c7407 commit 8aa6498
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
8 changes: 4 additions & 4 deletions css-conditional-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -999,12 +999,12 @@ interface CSSDocumentRule : CSSConditionRule {
<h3 id='the-css-interface'>
The <code>CSS</code> interface, and the <code title=''>supports()</code> function</h3>

The {{CSS}} interface holds useful CSS-related functions that do not belong elsewhere.
The {{CSS}} namespace holds useful CSS-related functions that do not belong elsewhere.

<pre class='idl'>
partial interface CSS {
static boolean supports(CSSOMString property, CSSOMString value);
static boolean supports(CSSOMString conditionText);
partial namespace CSS {
boolean supports(CSSOMString property, CSSOMString value);
boolean supports(CSSOMString conditionText);
};
</pre>

Expand Down
6 changes: 4 additions & 2 deletions css-images-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,13 @@ Using Out-Of-Document Sources: the <code>ElementSources</code> interface</h4>
The <a idl>elementSources</a> Map object provides this.

<pre class='idl'>
partial interface CSS {
[SameObject] readonly attribute Map elementSources;
partial namespace CSS {
// [SameObject] readonly attribute Map elementSources;
};
</pre>

Issue(428): IDL namespaces don't support attributes yet.

Any entries in the <a idl>elementSources</a> map with a string key
and a value that is an object providing a <a>paint source</a>
are made available to the ''element()'' function.
Expand Down
17 changes: 12 additions & 5 deletions cssom-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2812,16 +2812,23 @@ Utility APIs {#utility-apis}
The <code>CSS.escape()</code> Method {#the-css.escape()-method}
------------------------------------------------------

The <code>CSS</code> interface holds useful CSS-related functions that do not belong elsewhere.
The <code>CSS</code> namespace holds useful CSS-related functions that do not belong elsewhere.

<pre class=idl>
[Exposed=Window]
interface CSS {
static CSSOMString escape(CSSOMString ident);
namespace CSS {
CSSOMString escape(CSSOMString ident);
};
</pre>

The <dfn method for=CSS>escape(<var>ident</var>)</dfn> method must return the result of invoking <a>serialize an identifier</a> of
Issue: This was previously specified as an IDL interface
that only held static methods.
Switching to an IDL namespace is *nearly* identical,
so it's expected that there won't be any compat concerns.
If any are discovered, please report
so we can consider reverting this change.

The <dfn method for=CSS>escape(<var>ident</var>)</dfn> operation must return the result of invoking <a>serialize an identifier</a> of
<var>ident</var>.

<div class=example>
Expand All @@ -2835,7 +2842,7 @@ The <dfn method for=CSS>escape(<var>ident</var>)</dfn> method must return the re
<pre>var element = document.querySelector('a[href="#' + CSS.escape(fragment) + '"]');</pre>
</div>

Specifications that define static functions on the {{CSS}} interface and want to
Specifications that define operations on the {{CSS}} namespace and want to
store some state should store the state on the <a spec=html>current global
object</a>'s <a spec=html>associated <code>Document</code></a>.
<!-- https://github.com/w3c/csswg-drafts/issues/180 -->
Expand Down

0 comments on commit 8aa6498

Please sign in to comment.