Skip to content

Commit 783282e

Browse files
authored
Make option disabledness look for ancestor optgroups
Now that option elements can be descendants of optgroup elements instead of just children, the disabledness algorithm should look for ancestors intead of just a parent optgroup element. Fixes #11707.
1 parent b39bd1b commit 783282e

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

source

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56987,11 +56987,29 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
5698756987

5698856988
<div algorithm>
5698956989
<p>The <dfn element-attr for="option"><code data-x="attr-option-disabled">disabled</code></dfn>
56990-
attribute is a <span>boolean attribute</span>. An <code>option</code> element is <dfn
56991-
data-x="concept-option-disabled">disabled</dfn> if its <code
56992-
data-x="attr-option-disabled">disabled</code> attribute is present or if it is a child of an
56993-
<code>optgroup</code> element whose <code data-x="attr-optgroup-disabled">disabled</code>
56994-
attribute is present.</p>
56990+
attribute is a <span>boolean attribute</span>. An <code>option</code> element <var>option</var> is
56991+
<dfn data-x="concept-option-disabled">disabled</dfn> if the following steps return true:</p>
56992+
56993+
<ol>
56994+
<li><p>If <var>option</var>'s <code data-x="attr-option-disabled">disabled</code> attribute is
56995+
present, then return true.</p></li>
56996+
56997+
<li>
56998+
<p>For each <var>ancestor</var> of <var>insertedOption</var>'s <span
56999+
data-x="ancestor">ancestors</span> in reverse <span>tree order</span>:</p>
57000+
57001+
<ol>
57002+
<li><p>If <var>ancestor</var> is a <code>select</code>, <code>hr</code>, or <code>option</code>
57003+
element, then return false.</p></li>
57004+
57005+
<li><p>If <var>ancestor</var> is an <code>optgroup</code> element, then return true if
57006+
<var>ancestor</var>'s <code data-x="attr-optgroup-disabled">disabled</code> attribute is
57007+
present; otherwise false.</p></li>
57008+
</ol>
57009+
</li>
57010+
57011+
<li><p>Return false.</p></li>
57012+
</ol>
5699557013
</div>
5699657014

5699757015
<div w-nodev>

0 commit comments

Comments
 (0)