@@ -1863,6 +1863,67 @@ Rolling Back Cascade Layers: the ''revert-layer'' keyword</h4>
1863
1863
but not through any other [=author origin=] [=normal=] declarations.
1864
1864
1865
1865
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<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
+
1866
1927
<!--
1867
1928
████████ ████████ ██████
1868
1929
██ ██ ██ ██
@@ -1883,7 +1944,8 @@ Non-trivial changes since the <a href="https://www.w3.org/TR/2021/WD-css-cascade
1883
1944
1884
1945
* Added [[#value-aliasing]] section.
1885
1946
(<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> )
1887
1949
1888
1950
<h3 id="changes-2021-08">
1889
1951
Changes since the 29 August 2021 Working Draft</h3>
0 commit comments