Skip to content

Commit 6a8fa1e

Browse files
shs96cAutomatedTester
authored andcommitted
Element containers for OPTION elements are hard.
Let's go shopping. Or, alternatively, try and find the first ancestor datalist element. If that doesn't exist, then use the first ancestor select element. Closes #735
1 parent d7b572e commit 6a8fa1e

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

webdriver-spec.html

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4717,17 +4717,29 @@ <h2>Element State</h2>
47174717
<li><p>Return false.
47184718
</ol>
47194719

4720-
<p>An <a>element</a>’s <dfn>container</dfn> is:
4720+
<p>An <a><var>element</var></a>’s <dfn>container</dfn> is:
47214721

47224722
<dl class=switch>
47234723
<dt><a><code>option</code> element</a> in a valid <a>element context</a>
4724-
<dd><a><code>optgroup</code> element</a> in a valid <a>element context</a>
4725-
<dd><p>The <a>element</a>’s <a>element context</a>,
4726-
meaning its immediate parent node
4727-
in reverse tree-order originating from <a>element</a>
4728-
that is either a <a><code>datalist</code> element</a>
4729-
or a <a><code>select</code> element</a>.
4730-
4724+
<dt><a><code>optgroup</code> element</a> in a valid <a>element context</a>
4725+
<dd><p>The <a><var>element</var></a>'s <a>element context</a>, which
4726+
is determined by:
4727+
<ol>
4728+
<li><p>Let <var>datalist parent</var> be the
4729+
first <a><code>datalist</code> element</a> reached by traversing
4730+
the tree in reverse order from <var>element</var>,
4731+
or <a><code>undefined</code></a> if the root of the tree is
4732+
reached.
4733+
<li><p>Let <var>select parent</var> be the
4734+
first <a><code>select</code> element</a> reached by traversing
4735+
the tree in reverse order from <var>element</var>,
4736+
or <a><code>undefined</code></a> if the root of the tree is
4737+
reached.
4738+
<li><p>If <var>datalist parent</var>
4739+
is <a><code>undefined</code></a>, the <a>element context</a>
4740+
is <var>select parent</var>. Otherwise, the <a>element context</a>
4741+
is <var>datalist parent</var>.
4742+
</ol>
47314743
<dt><a><code>option</code> element</a> in an invalid <a>element context</a>
47324744
<dd><p>The element does not have a container.
47334745

0 commit comments

Comments
 (0)