Skip to content

Commit 6e8482b

Browse files
committed
[css-cascade-5] Define CSSOM Layer APIs #6576
1 parent a64a842 commit 6e8482b

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

css-cascade-5/Overview.bs

+63-1
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,67 @@ Rolling Back Cascade Layers: the ''revert-layer'' keyword</h4>
18631863
but not through any other [=author origin=] [=normal=] declarations.
18641864

18651865

1866+
<h2 id="layer-apis">Layer APIs</h2>
1867+
1868+
<h3 id='extensions-to-cssimportrule-interface'>
1869+
Extensions to the <code>CSSImportRule</code> interface</h3>
1870+
1871+
The <code>CSSImportRule</code> interface is extended as follows:
1872+
1873+
<pre class='idl'>
1874+
partial interface CSSImportRule {
1875+
readonly attribute CSSOMString layerName;
1876+
};
1877+
</pre>
1878+
1879+
<h3 id="the-csslayerblockrule-interface">
1880+
The <code>CSSLayerBlockRule</code> interface</h3>
1881+
1882+
The {{CSSLayerBlockRule}} interface represents
1883+
the ''@layer'' [[#layer-block|block rule]]:
1884+
1885+
<pre class='idl' export>
1886+
[Exposed=Window]
1887+
interface CSSLayerBlockRule : CSSGroupingRule {
1888+
readonly attribute CSSOMString name;
1889+
};
1890+
</pre>
1891+
1892+
Its <dfn attribute for=CSSLayerBlockRule>name</dfn> attribute represents
1893+
the [=layer name=] declared by the at-rule
1894+
as written, with white space removed--
1895+
and is an empty string if the layer is anonymous.
1896+
1897+
<div class="example">
1898+
<pre class='lang-css'>
1899+
@layer outer {
1900+
@layer foo . bar { }
1901+
}
1902+
</pre>
1903+
1904+
The {{CSSLayerBlockRule/name}} of the inner ''@layer'' rule
1905+
is “foo.bar” (and not “foo . bar” or “outer.foo.bar”).
1906+
</div>
1907+
1908+
<h3 id="the-csslayerstatementrule-interface">
1909+
The <code>CSSLayerStatementRule</code> interface</h3>
1910+
1911+
The {{CSSLayerStatementRule}} interface represents
1912+
the ''@layer'' [[#layer-empty|statement]]:
1913+
1914+
<pre class='idl' export>
1915+
[Exposed=Window]
1916+
interface CSSLayerStatementRule : CSSRule {
1917+
readonly attribute FrozenArray&lt;CSSOMString> nameList;
1918+
};
1919+
</pre>
1920+
1921+
Its <dfn attribute for=CSSLayerStatementRule>nameList</dfn> attribute represents
1922+
the (possibly empty) list of [=layer names=] declared by the at-rule,
1923+
normalized following the same rule as
1924+
the {{CSSLayerBlockRule}}’s {{CSSLayerBlockRule/name}} attribute.
1925+
1926+
18661927
<!--
18671928
████████ ████████ ██████
18681929
██ ██ ██ ██
@@ -1883,7 +1944,8 @@ Non-trivial changes since the <a href="https://www.w3.org/TR/2021/WD-css-cascade
18831944

18841945
* Added [[#value-aliasing]] section.
18851946
(<a href="https://github.com/w3c/csswg-drafts/issues/6193">Issue 6193</a>)
1886-
1947+
* Added [[#layer-apis]] section.
1948+
(<a href="https://github.com/w3c/csswg-drafts/issues/6576">Issue 6576</a>)
18871949

18881950
<h3 id="changes-2021-08">
18891951
Changes since the 29 August 2021 Working Draft</h3>

0 commit comments

Comments
 (0)