Skip to content

Commit

Permalink
Fix case where the directionality of a <bdi> could be null.
Browse files Browse the repository at this point in the history
In whatwg#9796 I refactored the term "auto directionality" to move the
fallback to the parent directionality out of the definition of "auto
directionality", since I needed the null result in one case to continue
a tree traversal rather than returning.

However, I missed fixing up one of the references to the term (should I
blame the line break?), leaving a case where the spec could define the
directionality of a <bdi> element as null.

This fixes that case, and converts the <ol> to a <dl class="switch">.
  • Loading branch information
dbaron committed Dec 19, 2023
1 parent f33d8b0 commit f19ed0d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -13599,19 +13599,24 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></code></pre> <!-- DO NOT REWRAP

<dt><span data-x="attr-dir-undefined-state">undefined</span></dt>
<dd>
<ol>
<li><p>If <var>element</var> is a <code>bdi</code> element, then return the <span>auto
directionality</span> of <var>element</var>.</p></li>
<dl class="switch">
<dt>If <var>element</var> is a <code>bdi</code> element and the <span>auto
directionality</span> of <var>element</var> is not null</dt>

<li><p>If <var>element</var> is an <code>input</code> element whose <code
<dd><p>Return the <span>auto directionality</span> of <var>element</var>.</p></dd>

<dt>If <var>element</var> is an <code>input</code> element whose <code
data-x="attr-input-type">type</code> attribute is in the <span
data-x="attr-input-type-tel">Telephone</span> state, then return '<span
data-x="concept-ltr">ltr</span>'.</p></li>
data-x="attr-input-type-tel">Telephone</span> state</dt>

<dd><p>Return '<span data-x="concept-ltr">ltr</span>'.</p></dd>
<!-- This looks odd, but is very much deliberate:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17835 -->

<li><p>Return the <span>parent directionality</span> of <var>element</var>.</p></li>
</ol>
<dt>Otherwise</dt>

<dd><p>Return the <span>parent directionality</span> of <var>element</var>.</p></dd>
</dl>
</dd>
</dl>

Expand Down

0 comments on commit f19ed0d

Please sign in to comment.