Skip to content

Commit 2cbd492

Browse files
committed
[css-shadow-parts-1] Clarify the algorithm with better names.
1 parent 199c0fe commit 2cbd492

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

css-shadow-parts-1/Overview.bs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,24 +142,25 @@ and exposing it could allow access to elements inside closed shadow roots.
142142
Part element maps are affected by the addition and removal of elements
143143
and changes to the part name lists and part name maps of elements in the DOM.
144144

145-
To calculate the part element map of a shadow root, |r|:
145+
To calculate the part element map of a shadow root, |outerRoot|:
146146

147147
<ol>
148-
<li>For each element, |el| within |r|
149-
<ol>
150-
<li>For each |name| in |el|'s part name list,
151-
add |el| to |r|'s part element map
148+
<li>For each element, |el| within |outerRoot|
149+
<ol>
150+
<li>For each |name| in |el|'s part name list,
151+
add |el| to |outerRoot|'s part element map
152152
under the key |name|.
153-
<li>If |el| is a shadow host itself, let |er| be its shadow root:
153+
<li>If |el| is a shadow host itself
154+
then let |innerRoot| be its shadow root:
154155
<ol>
155-
<li>Calculate |er|'s part element map.
156-
<li>For each key, |outerName|, in |r|'s part name map
156+
<li>Calculate |innerRoot|'s part element map.
157+
<li>For each key, |outerName|, in |el|'s part name map
157158
and for each token |innerName| under that key
158-
look up |innerName| in |er|'s shadow part element map
159+
look up |innerName| in |innerRoot|'s shadow part element map
159160
to get a (possibly empty) set of elements
160-
and add these elements to |r|'s part element map under |outerName|
161+
and add these elements to |outerRoot|'s part element map under |outerName|
161162
</ol>
162-
</ol>
163+
</ol>
163164
</ol>
164165

165166

0 commit comments

Comments
 (0)