@@ -13287,7 +13287,8 @@ Transport Protocol">HTTP</abbr> today.</p></code></pre> <!-- DO NOT REWRAP
13287
13287
<ref>XML</ref></p>
13288
13288
13289
13289
<p>If these attributes are omitted from an element, then the language of this element is the same
13290
- as the language of its parent element, if any.</p>
13290
+ as the language of its parent element, if any (except for <code>slot</code> elements in a
13291
+ <span>shadow tree</span>).</p>
13291
13292
13292
13293
<p>The <code data-x="attr-lang">lang</code> attribute in no namespace may be used on any <span
13293
13294
data-x="HTML elements">HTML element</span>.</p>
@@ -13318,28 +13319,36 @@ Transport Protocol">HTTP</abbr> today.</p></code></pre> <!-- DO NOT REWRAP
13318
13319
13319
13320
<hr>
13320
13321
13321
- <p>To determine the <dfn export for="Node">language</dfn> of a node, user agents must look at the
13322
- nearest ancestor element (including the element itself if the node is an element) that has a <span
13323
- data-x="attr-xml-lang"><code data-x="">lang</code> attribute in the <span>XML
13324
- namespace</span></span> set or is an <span data-x="HTML elements">HTML element</span> and has a
13325
- <code data-x="attr-lang">lang</code> in no namespace attribute set. That attribute specifies the
13326
- language of the node (regardless of its value).</p>
13327
-
13328
- <p>If both the <code data-x="attr-lang">lang</code> attribute in no namespace and the <span
13329
- data-x="attr-xml-lang"><code data-x="">lang</code> attribute in the <span>XML
13330
- namespace</span></span> are set on an element, user agents must use the <span
13331
- data-x="attr-xml-lang"><code data-x="">lang</code> attribute in the <span>XML
13332
- namespace</span></span>, and the <code data-x="attr-lang">lang</code> attribute in no namespace
13333
- must be <span data-x="ignore">ignored</span> for the purposes of determining the element's
13334
- language.</p>
13322
+ <p>To determine the <dfn export for="Node">language</dfn> of a node, user agents must use the
13323
+ first appropriate step in the following list:</p>
13324
+
13325
+ <dl class="switch">
13326
+ <dt>If the node is an element that has a <span data-x="attr-xml-lang"><code data-x="">lang</code>
13327
+ attribute in the <span>XML namespace</span></span> set</dt>
13328
+ <dd><p>Use the value of that attribute.</p></dd>
13329
+
13330
+ <dt>If the node is an <span data-x="HTML elements">HTML element</span> and has a <code
13331
+ data-x="attr-lang">lang</code> in no namespace attribute set.</dt>
13332
+ <dd><p>Use the value of that attribute.</p></dd>
13335
13333
13336
- <p>If node's <span data-x="inclusive ancestor">inclusive ancestors</span> do not have either
13337
- attribute set, but there is a <span>pragma-set default language</span> set, then that is the
13338
- language of the node. If there is no <span>pragma-set default language</span> set, then language
13339
- information from a higher-level protocol (such as HTTP), if any, must be used as the final
13340
- fallback language instead. In the absence of any such language information, and in cases where the
13341
- higher-level protocol reports multiple languages, the language of the node is unknown, and the
13342
- corresponding language tag is the empty string.</p>
13334
+ <dt>If the node's parent is a <span>shadow root</span></dt>
13335
+ <dt>If the node is a <code>slot</code> element whose <span>root</span> is a <span>shadow
13336
+ root</span></dt>
13337
+ <dd><p>Use the <span>language</span> of that <span>shadow root</span>'s <span
13338
+ data-x="concept-DocumentFragment-host">host</span>.</p></dd>
13339
+
13340
+ <!-- this assumes that if there's an ancestor element, the parent must be an element -->
13341
+ <dt>If the node's <span>parent element</span> is not null</dt>
13342
+ <dd><p>Use the <span>language</span> of that <span>parent element</span>.</p></dd>
13343
+
13344
+ <dt>Otherwise</dt>
13345
+ <dd><p>If there is a <span>pragma-set default language</span> set, then that is the language of
13346
+ the node. If there is no <span>pragma-set default language</span> set, then language information
13347
+ from a higher-level protocol (such as HTTP), if any, must be used as the final fallback language
13348
+ instead. In the absence of any such language information, and in cases where the higher-level
13349
+ protocol reports multiple languages, the language of the node is unknown, and the corresponding
13350
+ language tag is the empty string.</p></dd>
13351
+ </dl>
13343
13352
13344
13353
<p>If the resulting value is not a recognized language tag, then it must be treated as an unknown
13345
13354
language having the given language tag, distinct from all other languages. For the purposes of
@@ -13555,7 +13564,17 @@ Transport Protocol">HTTP</abbr> today.</p></code></pre> <!-- DO NOT REWRAP
13555
13564
<dd><p>Return '<span data-x="concept-rtl">rtl</span>'.</p></dd>
13556
13565
13557
13566
<dt><span data-x="attr-dir-auto-state">auto</span></dt>
13558
- <dd><p>Return the <span>auto directionality</span> of <var>element</var>.</p></dd>
13567
+ <dd>
13568
+ <ol>
13569
+ <li><p>Let <var>result</var> be the <span>auto directionality</span> of
13570
+ <var>element</var>.</p></li>
13571
+
13572
+ <li><p>If <var>result</var> is null, then return the <span>parent directionality</span> of
13573
+ <var>element</var>.</p></li>
13574
+
13575
+ <li><p>Return <var>result</var>.</p></li>
13576
+ </ol>
13577
+ </dd>
13559
13578
13560
13579
<dt><span data-x="attr-dir-undefined-state">undefined</span></dt>
13561
13580
<dd>
@@ -13598,47 +13617,106 @@ Transport Protocol">HTTP</abbr> today.</p></code></pre> <!-- DO NOT REWRAP
13598
13617
<li><p>If <var>element</var>'s <span data-x="concept-fe-value">value</span> is not the empty
13599
13618
string, then return '<span data-x="concept-ltr">ltr</span>'.</p></li>
13600
13619
13601
- <li><p>Return the <span>parent directionality</span> of <var>element</var> .</p></li>
13620
+ <li><p>Return null .</p></li>
13602
13621
</ol>
13603
13622
</li>
13604
13623
13605
- <li><p>Let <var>codePoint</var> be null.</p></li>
13624
+ <li>
13625
+ <p>If <var>element</var> is a <code>slot</code> element whose <span>root</span> is a
13626
+ <span>shadow root</span> and <var>element</var>'s <span>assigned nodes</span> are not empty:</p>
13627
+
13628
+ <ol>
13629
+ <li>
13630
+ <p><span data-x="list iterate">For each</span> node <var>child</var> of <var>element</var>'s
13631
+ <span>assigned nodes</span>:</p>
13632
+
13633
+ <ol>
13634
+ <li><p>Let <var>childDirection</var> be null.</p></li>
13635
+
13636
+ <li><p>If <var>child</var> is a <code>Text</code> node, then set <var>childDirection</var> to
13637
+ the <span>text node directionality</span> of <var>child</var>.</p></li>
13638
+
13639
+ <li>
13640
+ <p>Otherwise:</p>
13641
+
13642
+ <ol>
13643
+ <li><p><span>Assert</span>: <var>child</var> is an <code>Element</code> node.</p></li>
13644
+
13645
+ <li><p>Set <var>childDirection</var> to the <span>auto directionality</span> of
13646
+ <var>child</var>.</p></li>
13647
+ </ol>
13648
+ </li>
13649
+
13650
+ <li><p>If <var>childDirection</var> is not null, then return
13651
+ <var>childDirection</var>.</p></li>
13652
+ </ol>
13653
+ </li>
13654
+
13655
+ <li><p>Return null.</p></li>
13656
+ </ol>
13657
+ </li>
13606
13658
13607
13659
<li>
13608
- <p>For each <code>Text</code> node <var>text</var> that is a descendant of <var>element</var>,
13609
- in <span>tree order</span>:</p>
13660
+ <p><span data-x="list iterate">For each</span> node <var>descendant</var> of
13661
+ <var>element</var>'s <span data-x="descendant">descendants</span>, in <span>tree
13662
+ order</span>:</p>
13610
13663
13611
13664
<ol>
13612
13665
<li>
13613
- <p>If <var>text </var> has an ancestor element that is a descendant of <var>element</var> and
13614
- is also one of</p>
13666
+ <p>If <var>descendant </var> has an ancestor element that is a descendant of <var>element</var>
13667
+ and is also one of</p>
13615
13668
13616
13669
<ul class="brief">
13617
13670
<li>a <code>bdi</code> element</li>
13618
13671
<li>a <code>script</code> element</li>
13619
13672
<li>a <code>style</code> element</li>
13620
13673
<li>a <code>textarea</code> element</li>
13674
+ <li>a <code>slot</code> element whose <span>root</span> is a <span>shadow
13675
+ root</span></li>
13621
13676
<li>an element whose <code data-x="attr-dir">dir</code> attribute is not in the <span
13622
13677
data-x="attr-dir-undefined-state">undefined</span> state</li>
13623
13678
</ul>
13624
13679
13625
13680
<p>then <span>continue</span>.</p>
13626
13681
</li>
13627
13682
13628
- <li><p>If <var>text</var>'s <span data-x="concept-cd-data">data</span> does not contain a code
13629
- point whose bidirectional character type is L, AL, or R, then <span>continue </span>.
13630
- <ref>BIDI</ref> </p></li >
13683
+ <li>
13684
+ <p>If <var>descendant</var> is a <code>slot</code> element whose <span>root </span> is a
13685
+ <span>shadow root</span>, then: </p>
13631
13686
13632
- <li><p>Set <var>codePoint</var> to the first code point in <var>text</var>'s <span
13633
- data-x="concept-cd-data">data</span> whose bidirectional character type is L, AL, or
13634
- R.</p></li>
13687
+ <ol>
13688
+ <li><p>Let <var>result</var> be the <span>auto directionality</span> of
13689
+ <var>descendant</var>.</p></li>.
13690
+
13691
+ <li><p>If <var>result</var> is not null, then return <var>result</var>.</p></li>
13635
13692
13636
- <li><p><span>Break</span>.</p></li>
13693
+ <li><p>Return '<span data-x="concept-ltr">ltr</span>'.</p></li>
13694
+ </ol>
13695
+ </li>
13696
+
13697
+ <li><p>If <var>descendant</var> is not a <code>Text</code> node, then
13698
+ <span>continue</span>.</p></li>
13699
+
13700
+ <li><p>Let <var>result</var> be the <span>text node directionality</span> of
13701
+ <var>descendant</var>.</li>
13702
+
13703
+ <li><p>If <var>result</var> is not null, then return <var>result</var>.</p></li>
13637
13704
</ol>
13638
13705
</li>
13639
13706
13640
- <li><p>If <var>codePoint</var> is null, then return the <span>parent directionality</span> of
13641
- <var>element</var>.</p></li>
13707
+ <li><p>Return null.</p></li>
13708
+ </ol>
13709
+
13710
+ <p>To compute the <dfn>text node directionality</dfn> given a <code>Text</code> node
13711
+ <var>text</var>:</p>
13712
+
13713
+ <ol>
13714
+ <li><p>If <var>text</var>'s <span data-x="concept-cd-data">data</span> does not contain a code
13715
+ point whose bidirectional character type is L, AL, or R, then return null.
13716
+ <ref>BIDI</ref></p></li>
13717
+
13718
+ <li><p>Let <var>codePoint</var> be the first code point in <var>text</var>'s <span
13719
+ data-x="concept-cd-data">data</span> whose bidirectional character type is L, AL, or R.</p></li>
13642
13720
13643
13721
<li><p>If <var>codePoint</var> is of bidirectional character type AL or R, then return '<span
13644
13722
data-x="concept-rtl">rtl</span>'.</p></li>
@@ -13650,11 +13728,21 @@ Transport Protocol">HTTP</abbr> today.</p></code></pre> <!-- DO NOT REWRAP
13650
13728
<p>To compute the <dfn>parent directionality</dfn> given an element <var>element</var>:</p>
13651
13729
13652
13730
<ol>
13653
- <li><p>If <var>element</var> has no <span>parent element</span>, then return '<span
13654
- data-x="concept-ltr">ltr</span>'.</p></li>
13731
+ <li><p>If <var>element</var> is a <code>slot</code> element whose <span>root</span> is a
13732
+ <span>shadow root</span>, then return the <span data-x="the directionality">directionality</span>
13733
+ of <var>element</var>'s <span>root</span>'s <span
13734
+ data-x="concept-DocumentFragment-host">host</span>.</p></li>
13735
+
13736
+ <li><p>Let <var>parentNode</var> be <var>element</var>'s parent node.</p></li>
13737
+
13738
+ <li><p>If <var>parentNode</var> is a <span>shadow root</span>, then return the <span data-x="the
13739
+ directionality">directionality</span> of <var>parentNode</var>'s <span
13740
+ data-x="concept-DocumentFragment-host">host</span>.</p></li>
13741
+
13742
+ <li><p>If <var>parentNode</var> is an element, then return the <span data-x="the
13743
+ directionality">directionality</span> of <var>parentNode</var>.</p></li>
13655
13744
13656
- <li><p>Return <span data-x="the directionality">directionality</span> of <var>element</var>'s
13657
- <span data-x="parent element">parent</span>.</p></li>
13745
+ <li><p>Return '<span data-x="concept-ltr">ltr</span>'.</p></li>
13658
13746
</ol>
13659
13747
13660
13748
<div w-nodev>
@@ -129536,15 +129624,16 @@ br[clear=all i], br[clear=both i] { clear: both; }</code></pre>
129536
129624
129537
129625
<pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";
129538
129626
129539
- [dir]:dir(ltr), bdi:dir(ltr), input[type=tel i]:dir(ltr) { direction: ltr; }
129540
- [dir]:dir(rtl), bdi:dir(rtl) { direction: rtl; }
129627
+ [dir]:dir(ltr), slot:dir(ltr), bdi:dir(ltr), input[type=tel i]:dir(ltr) { direction: ltr; }
129628
+ [dir]:dir(rtl), slot:dir(rtl), bdi:dir(rtl) { direction: rtl; }
129541
129629
129542
129630
address, blockquote, center, div, figure, figcaption, footer, form, header, hr,
129543
129631
legend, listing, main, p, plaintext, pre, summary, xmp, article, aside, h1, h2,
129544
129632
h3, h4, h5, h6, hgroup, nav, section, search, table, caption, colgroup, col,
129545
129633
thead, tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, bdi, output,
129546
- [dir=ltr i], [dir=rtl i], [dir=auto i] {
129547
- unicode-bidi: isolate; <!-- anything that's similar to display:block, plus <bdi>, <output>, and dir="" -->
129634
+ slot, [dir=ltr i], [dir=rtl i], [dir=auto i] {
129635
+ unicode-bidi: isolate; <!-- anything that's similar to display:block, plus
129636
+ <bdi>, <output>, <slot>, and dir="" -->
129548
129637
}
129549
129638
129550
129639
bdo, bdo[dir] { unicode-bidi: isolate-override; } <!-- bdo[dir] rule is to override the otherwise higher-specificity attribute selectors in the previous rule -->
0 commit comments