Skip to content

Commit 2b10ddf

Browse files
committed
[css-shadow-parts-1] Rename partmap to exposedparts and add IDL
1 parent b206f31 commit 2b10ddf

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

css-shadow-parts-1/Overview.bs

+18-8
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ as authors can use ''::part()'' without fear of accidental over-styling.
121121
Exposing a Shadow Element: {#exposing}
122122
=============================================================
123123
Elements in a <a>shadow tree</a> may be exposed for styling by stylesheets outside the tree
124-
using the part and partmap attributes.
124+
using the part and exposedparts attributes.
125125

126126
Each element has a <dfn export for="element">part name list</dfn>
127127
which is an [=ordered set=] of tokens.
@@ -133,8 +133,6 @@ with keys that are [=strings=]
133133
and values that are [=ordered sets=] of [=strings=]
134134
(part names that are selectable inside this element).
135135

136-
Issue(w3c/csswg-drafts#2414): Document how the part name map will be exposed via IDL.
137-
138136
Each <a>shadow root</a> can be thought of as having a <dfn export for="shadow root">part element map</dfn>
139137
with keys that are [=strings=]
140138
and values that are [=ordered sets=] of elements.
@@ -199,16 +197,16 @@ not an id or tagname.
199197
&lt;/script&gt;
200198
</pre>
201199

202-
Forwarding a Shadow Element: the <{html-global/partmap}> attribute {#partmap-attr}
200+
Forwarding a Shadow Element: the <{html-global/exposedparts}> attribute {#exposedparts-attr}
203201
----------------------------------------------------------------------------------
204-
Any element in a shadow tree can have a <dfn element-attr for=html-global>partmap</dfn> attribute.
202+
Any element in a shadow tree can have a <dfn element-attr for=html-global>exposedparts</dfn> attribute.
205203
If the element is a shadow host,
206204
this is used to allow styling of parts from hosts inside the <a>shadow tree</a>
207205
by rules outside this the <a>shadow tree</a>
208206
(as if they were elements in the same tree as the host,
209207
named by a part attribute).
210208

211-
The partmap attribute is parsed as a comma-separated list of part mappings.
209+
The exposedparts attribute is parsed as a comma-separated list of part mappings.
212210
Each part mapping is one of:
213211

214212
<dl class=switch>
@@ -233,7 +231,7 @@ Issue(w3c/csswg-drafts#2411): Decide whether to allow "ident1 => ident2 ident3 .
233231
as shorthand for "ident1 ident2, ident1 ident3, ...".
234232

235233
Issue(w3c/csswg-drafts#2411): Decide whether to allow wild-card forwarding,
236-
e.g partmap="button-* buttons".
234+
e.g exposedparts="button-* buttons".
237235
Consider excluding sub-parts that have been explicitly forwarded.
238236
Consider a mechanism to exclude sub-parts without forwarding them.
239237

@@ -243,7 +241,7 @@ Consider a mechanism to exclude sub-parts without forwarding them.
243241
&lt;/style&gt;
244242

245243
&lt;template id="c-e-outer-template"&gt;
246-
&lt;c-e-inner <b>partmap="innerspan textspan"</b>&gt;&lt;/c-e-inner&gt;
244+
&lt;c-e-inner <b>exposedparts="innerspan textspan"</b>&gt;&lt;/c-e-inner&gt;
247245
&lt;/template&gt;
248246

249247
&lt;template id="c-e-inner-template"&gt;
@@ -366,3 +364,15 @@ but never match additional <a>shadow-part pseudo-elements</a>.
366364
would select just the one button's label,
367365
ignoring any other labels.
368366
</div>
367+
368+
Extensions to the {{Element}} Interface {#idl}
369+
==============================================
370+
371+
We expose the `part` and `exposedparts` attributes as read/write string properties on Element.
372+
373+
<pre class=idl>
374+
partial interface Element {
375+
attribute DOMString part;
376+
attribute DOMString exposedParts;
377+
};
378+
</pre>

0 commit comments

Comments
 (0)