Skip to content

Commit

Permalink
[giow] (2) Make RadioNodeList's radio button logic support the magica…
Browse files Browse the repository at this point in the history
…l 'on' value.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=26353
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8744 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 4, 2014
1 parent 5f3cea7 commit 193ac0a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
12 changes: 8 additions & 4 deletions complete.html
Expand Up @@ -5150,15 +5150,19 @@ <h5 id=htmlformcontrolscollection>2.7.2.2 HTMLFormControlsCollection</h5>

<ol><li><p>Let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-4>tree order</a>
represented by the <code id=htmlformcontrolscollection:radionodelist-9><a href=#radionodelist>RadioNodeList</a></code> object that is an <code id=htmlformcontrolscollection:the-input-element><a href=#the-input-element>input</a></code> element whose
<code id=htmlformcontrolscollection:attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)">Radio Button</a> state and whose <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked>checkedness</a> is true. Otherwise, let it be null.<li><p>If <var>element</var> is null, or if it is an element with no <code id=htmlformcontrolscollection:attr-input-value><a href=#attr-input-value>value</a></code> attribute, return the empty string.<li><p>Otherwise, return the value of <var>element</var>'s <code id=htmlformcontrolscollection:attr-input-value-2><a href=#attr-input-value>value</a></code> attribute.</ol>
<code id=htmlformcontrolscollection:attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)">Radio Button</a> state and whose <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked>checkedness</a> is true. Otherwise, let it be null.<li><p>If <var>element</var> is null, return the empty string.<li><p>If <var>element</var> is an element with no <code id=htmlformcontrolscollection:attr-input-value><a href=#attr-input-value>value</a></code> attribute, return the string "<code>on</code>".<li><p>Otherwise, return the value of <var>element</var>'s <code id=htmlformcontrolscollection:attr-input-value-2><a href=#attr-input-value>value</a></code> attribute.</ol>

<p>On setting, the <code id=htmlformcontrolscollection:dom-radionodelist-value-2><a href=#dom-radionodelist-value>value</a></code> IDL attribute must run the
following steps:</p>

<ol><li><p>Let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-5>tree order</a>
<ol><li><p>If the new value is the string "<code>on</code>": let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-5>tree order</a>
represented by the <code id=htmlformcontrolscollection:radionodelist-10><a href=#radionodelist>RadioNodeList</a></code> object that is an <code id=htmlformcontrolscollection:the-input-element-2><a href=#the-input-element>input</a></code> element whose
<code id=htmlformcontrolscollection:attr-input-type-2><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)-2">Radio Button</a> state and whose <code id=htmlformcontrolscollection:attr-input-value-3><a href=#attr-input-value>value</a></code> content attribute is present and equal to the new value, if
any. Otherwise, let it be null.<li><p>If <var>element</var> is not null, then set its <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked-2>checkedness</a> to true.</p>
<code id=htmlformcontrolscollection:attr-input-type-2><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)-2">Radio Button</a> state and whose <code id=htmlformcontrolscollection:attr-input-value-3><a href=#attr-input-value>value</a></code> content attribute is either absent, or present and equal to the new value, if any. If no such element exists, then instead let <var>element</var> be null.</p>

<p>Otherwise: let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-6>tree order</a>
represented by the <code id=htmlformcontrolscollection:radionodelist-11><a href=#radionodelist>RadioNodeList</a></code> object that is an <code id=htmlformcontrolscollection:the-input-element-3><a href=#the-input-element>input</a></code> element whose
<code id=htmlformcontrolscollection:attr-input-type-3><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)-3">Radio Button</a> state and whose <code id=htmlformcontrolscollection:attr-input-value-4><a href=#attr-input-value>value</a></code> content attribute is present and equal to the new value, if
any. If no such element exists, then instead let <var>element</var> be null.<li><p>If <var>element</var> is not null, then set its <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked-2>checkedness</a> to true.</p>

</ol>

Expand Down
12 changes: 8 additions & 4 deletions index
Expand Up @@ -5150,15 +5150,19 @@ interface <dfn id=radionodelist>RadioNodeList</dfn> : <a href=#nodelist id=htmlf

<ol><li><p>Let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-4>tree order</a>
represented by the <code id=htmlformcontrolscollection:radionodelist-9><a href=#radionodelist>RadioNodeList</a></code> object that is an <code id=htmlformcontrolscollection:the-input-element><a href=#the-input-element>input</a></code> element whose
<code id=htmlformcontrolscollection:attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)">Radio Button</a> state and whose <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked>checkedness</a> is true. Otherwise, let it be null.<li><p>If <var>element</var> is null, or if it is an element with no <code id=htmlformcontrolscollection:attr-input-value><a href=#attr-input-value>value</a></code> attribute, return the empty string.<li><p>Otherwise, return the value of <var>element</var>'s <code id=htmlformcontrolscollection:attr-input-value-2><a href=#attr-input-value>value</a></code> attribute.</ol>
<code id=htmlformcontrolscollection:attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)">Radio Button</a> state and whose <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked>checkedness</a> is true. Otherwise, let it be null.<li><p>If <var>element</var> is null, return the empty string.<li><p>If <var>element</var> is an element with no <code id=htmlformcontrolscollection:attr-input-value><a href=#attr-input-value>value</a></code> attribute, return the string "<code>on</code>".<li><p>Otherwise, return the value of <var>element</var>'s <code id=htmlformcontrolscollection:attr-input-value-2><a href=#attr-input-value>value</a></code> attribute.</ol>

<p>On setting, the <code id=htmlformcontrolscollection:dom-radionodelist-value-2><a href=#dom-radionodelist-value>value</a></code> IDL attribute must run the
following steps:</p>

<ol><li><p>Let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-5>tree order</a>
<ol><li><p>If the new value is the string "<code>on</code>": let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-5>tree order</a>
represented by the <code id=htmlformcontrolscollection:radionodelist-10><a href=#radionodelist>RadioNodeList</a></code> object that is an <code id=htmlformcontrolscollection:the-input-element-2><a href=#the-input-element>input</a></code> element whose
<code id=htmlformcontrolscollection:attr-input-type-2><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)-2">Radio Button</a> state and whose <code id=htmlformcontrolscollection:attr-input-value-3><a href=#attr-input-value>value</a></code> content attribute is present and equal to the new value, if
any. Otherwise, let it be null.<li><p>If <var>element</var> is not null, then set its <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked-2>checkedness</a> to true.</p>
<code id=htmlformcontrolscollection:attr-input-type-2><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)-2">Radio Button</a> state and whose <code id=htmlformcontrolscollection:attr-input-value-3><a href=#attr-input-value>value</a></code> content attribute is either absent, or present and equal to the new value, if any. If no such element exists, then instead let <var>element</var> be null.</p>

<p>Otherwise: let <var>element</var> be the first element in <a href=#tree-order id=htmlformcontrolscollection:tree-order-6>tree order</a>
represented by the <code id=htmlformcontrolscollection:radionodelist-11><a href=#radionodelist>RadioNodeList</a></code> object that is an <code id=htmlformcontrolscollection:the-input-element-3><a href=#the-input-element>input</a></code> element whose
<code id=htmlformcontrolscollection:attr-input-type-3><a href=#attr-input-type>type</a></code> attribute is in the <a href="#radio-button-state-(type=radio)" id="htmlformcontrolscollection:radio-button-state-(type=radio)-3">Radio Button</a> state and whose <code id=htmlformcontrolscollection:attr-input-value-4><a href=#attr-input-value>value</a></code> content attribute is present and equal to the new value, if
any. If no such element exists, then instead let <var>element</var> be null.<li><p>If <var>element</var> is not null, then set its <a href=#concept-fe-checked id=htmlformcontrolscollection:concept-fe-checked-2>checkedness</a> to true.</p>

</ol>

Expand Down
16 changes: 12 additions & 4 deletions source
Expand Up @@ -7643,8 +7643,10 @@ interface <dfn>RadioNodeList</dfn> : <span>NodeList</span> {
data-x="attr-input-type-radio">Radio Button</span> state and whose <span
data-x="concept-fe-checked">checkedness</span> is true. Otherwise, let it be null.</p></li>

<li><p>If <var>element</var> is null, or if it is an element with no <code
data-x="attr-input-value">value</code> attribute, return the empty string.</p></li>
<li><p>If <var>element</var> is null, return the empty string.</p></li>

<li><p>If <var>element</var> is an element with no <code
data-x="attr-input-value">value</code> attribute, return the string "<code data-x="">on</code>".</p></li>

<li><p>Otherwise, return the value of <var>element</var>'s <code
data-x="attr-input-value">value</code> attribute.</p></li>
Expand All @@ -7656,12 +7658,18 @@ interface <dfn>RadioNodeList</dfn> : <span>NodeList</span> {

<ol>

<li><p>Let <var>element</var> be the first element in <span>tree order</span>
<li><p>If the new value is the string "<code data-x="">on</code>": let <var>element</var> be the first element in <span>tree order</span>
represented by the <code>RadioNodeList</code> object that 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-radio">Radio Button</span> state and whose <code
data-x="attr-input-value">value</code> content attribute is either absent, or present and equal to the new value, if any. If no such element exists, then instead let <var>element</var> be null.</p>

<p>Otherwise: let <var>element</var> be the first element in <span>tree order</span>
represented by the <code>RadioNodeList</code> object that 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-radio">Radio Button</span> state and whose <code
data-x="attr-input-value">value</code> content attribute is present and equal to the new value, if
any. Otherwise, let it be null.</p></li>
any. If no such element exists, then instead let <var>element</var> be null.</p></li>

<li><p>If <var>element</var> is not null, then set its <span
data-x="concept-fe-checked">checkedness</span> to true.</p>
Expand Down

0 comments on commit 193ac0a

Please sign in to comment.