-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-cascade-5] Define CSSOM Layer APIs #6576
- Loading branch information
1 parent
a64a842
commit 6e8482b
Showing
1 changed file
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1863,6 +1863,67 @@ Rolling Back Cascade Layers: the ''revert-layer'' keyword</h4> | |
but not through any other [=author origin=] [=normal=] declarations. | ||
|
||
|
||
<h2 id="layer-apis">Layer APIs</h2> | ||
|
||
<h3 id='extensions-to-cssimportrule-interface'> | ||
Extensions to the <code>CSSImportRule</code> interface</h3> | ||
|
||
The <code>CSSImportRule</code> interface is extended as follows: | ||
|
||
<pre class='idl'> | ||
partial interface CSSImportRule { | ||
readonly attribute CSSOMString layerName; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
}; | ||
</pre> | ||
|
||
<h3 id="the-csslayerblockrule-interface"> | ||
The <code>CSSLayerBlockRule</code> interface</h3> | ||
|
||
The {{CSSLayerBlockRule}} interface represents | ||
the ''@layer'' [[#layer-block|block rule]]: | ||
|
||
<pre class='idl' export> | ||
[Exposed=Window] | ||
interface CSSLayerBlockRule : CSSGroupingRule { | ||
readonly attribute CSSOMString name; | ||
}; | ||
</pre> | ||
|
||
Its <dfn attribute for=CSSLayerBlockRule>name</dfn> attribute represents | ||
the [=layer name=] declared by the at-rule | ||
as written, with white space removed-- | ||
This comment has been minimized.
Sorry, something went wrong.
xiaochengh
Contributor
|
||
and is an empty string if the layer is anonymous. | ||
|
||
<div class="example"> | ||
<pre class='lang-css'> | ||
@layer outer { | ||
@layer foo . bar { } | ||
} | ||
</pre> | ||
|
||
The {{CSSLayerBlockRule/name}} of the inner ''@layer'' rule | ||
is “foo.bar” (and not “foo . bar” or “outer.foo.bar”). | ||
</div> | ||
|
||
<h3 id="the-csslayerstatementrule-interface"> | ||
The <code>CSSLayerStatementRule</code> interface</h3> | ||
|
||
The {{CSSLayerStatementRule}} interface represents | ||
the ''@layer'' [[#layer-empty|statement]]: | ||
|
||
<pre class='idl' export> | ||
[Exposed=Window] | ||
interface CSSLayerStatementRule : CSSRule { | ||
readonly attribute FrozenArray<CSSOMString> nameList; | ||
}; | ||
</pre> | ||
|
||
Its <dfn attribute for=CSSLayerStatementRule>nameList</dfn> attribute represents | ||
the (possibly empty) list of [=layer names=] declared by the at-rule, | ||
This comment has been minimized.
Sorry, something went wrong.
xiaochengh
Contributor
|
||
normalized following the same rule as | ||
the {{CSSLayerBlockRule}}’s {{CSSLayerBlockRule/name}} attribute. | ||
|
||
|
||
<!-- | ||
████████ ████████ ██████ | ||
██ ██ ██ ██ | ||
|
@@ -1883,7 +1944,8 @@ Non-trivial changes since the <a href="https://www.w3.org/TR/2021/WD-css-cascade | |
|
||
* Added [[#value-aliasing]] section. | ||
(<a href="https://github.com/w3c/csswg-drafts/issues/6193">Issue 6193</a>) | ||
|
||
* Added [[#layer-apis]] section. | ||
(<a href="https://github.com/w3c/csswg-drafts/issues/6576">Issue 6576</a>) | ||
|
||
<h3 id="changes-2021-08"> | ||
Changes since the 29 August 2021 Working Draft</h3> | ||
|
1 comment
on commit 6e8482b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general shape looks good! Just some comments regarding some details.
We should also clarify that for anonymous layers,
layerName
is the empty string.