Skip to content

Commit

Permalink
[giow] (3) Match reality, and factor out an algorithm.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=20780
Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@7763 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 21, 2013
1 parent c061142 commit 3d07406
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 36 deletions.
22 changes: 11 additions & 11 deletions complete.html
Expand Up @@ -4157,6 +4157,11 @@ <h4 id=common-parser-idioms><span class=secno>2.4.1 </span>Common parser idioms<
user agent must remove all <a href=#space-character title="space character">space characters</a> that are at the
start or end of the string.</p>

<p>When a user agent is to <dfn id=strip-and-collapse-whitespace>strip and collapse whitespace</dfn> in a string, it must replace
any sequence of one or more consecutive <a href=#space-character title="space character">space characters</a> in
that string with a single U+0020 SPACE character, and then <a href=#strip-leading-and-trailing-whitespace>strip leading and trailing
whitespace</a> from that string.</p>

<p>When a user agent has to <dfn id=strictly-split-a-string>strictly split a string</dfn> on a particular delimiter character
<var title="">delimiter</var>, it must use the following algorithm:</p>

Expand Down Expand Up @@ -8591,9 +8596,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
the empty string if <a href=#the-title-element-0>the <code>title</code> element</a> is
null.</li>

<li><p>Replace any sequence of one or more consecutive <a href=#space-character title="space character">space characters</a> in <var title="">value</var> with a single U+0020 SPACE character.</li>

<li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">value</var>.</li>
<li><p><a href=#strip-and-collapse-whitespace>Strip and collapse whitespace</a> in <var title="">value</var>.</li>

<li><p>Return <var title="">value</var>.</li>

Expand Down Expand Up @@ -50795,14 +50798,11 @@ <h4 id=the-option-element><span class=secno>4.10.12 </span>The <dfn><code>option
element's <a href=#concept-option-index title=concept-option-index>index</a>.</p>

<p>The <dfn id=dom-option-text title=dom-option-text><code>text</code></dfn> IDL attribute, on getting, must return
the concatenation of <a href=#concept-cd-data title=concept-cd-data>data</a> of all the <code><a href=#text>Text</a></code> node
descendants of the <code><a href=#the-option-element>option</a></code> element, in <a href=#tree-order>tree order</a>, excluding any that are
descendants of descendants of the <code><a href=#the-option-element>option</a></code> element that are themselves
<code><a href=#the-script-element>script</a></code> elements in the <a href=#html-namespace-0>HTML namespace</a> or <code title="">script</code>
elements in the <a href=#svg-namespace>SVG namespace</a>, with <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing
whitespace">leading and trailing whitespace stripped</a>, and with any sequences of two or more
<a href=#space-character title="space character">space characters</a> replaced by a single U+0020 SPACE
character.</p>
the result of <a href=#strip-and-collapse-whitespace title="strip and collapse whitespace">stripping and collapsing
whitespace</a> from the concatenation of <a href=#concept-cd-data title=concept-cd-data>data</a> of all the
<code><a href=#text>Text</a></code> node descendants of the <code><a href=#the-option-element>option</a></code> element, in <a href=#tree-order>tree order</a>,
excluding any that are descendants of descendants of the <code><a href=#the-option-element>option</a></code> element that are
themselves <code><a href=#the-script-element>script</a></code> elements in the <a href=#html-namespace-0>HTML namespace</a> or <code title="">script</code> elements in the <a href=#svg-namespace>SVG namespace</a>.</p>

<p>On setting, the <code title=dom-option-text><a href=#dom-option-text>text</a></code> attribute must act as if the
<code><a href=#textcontent>textContent</a></code> IDL attribute on the element had been set to the new value.</p>
Expand Down
22 changes: 11 additions & 11 deletions index
Expand Up @@ -4157,6 +4157,11 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
user agent must remove all <a href=#space-character title="space character">space characters</a> that are at the
start or end of the string.</p>

<p>When a user agent is to <dfn id=strip-and-collapse-whitespace>strip and collapse whitespace</dfn> in a string, it must replace
any sequence of one or more consecutive <a href=#space-character title="space character">space characters</a> in
that string with a single U+0020 SPACE character, and then <a href=#strip-leading-and-trailing-whitespace>strip leading and trailing
whitespace</a> from that string.</p>

<p>When a user agent has to <dfn id=strictly-split-a-string>strictly split a string</dfn> on a particular delimiter character
<var title="">delimiter</var>, it must use the following algorithm:</p>

Expand Down Expand Up @@ -8591,9 +8596,7 @@ partial /*sealed*/ interface <dfn id=document>Document</dfn> {
the empty string if <a href=#the-title-element-0>the <code>title</code> element</a> is
null.</li>

<li><p>Replace any sequence of one or more consecutive <a href=#space-character title="space character">space characters</a> in <var title="">value</var> with a single U+0020 SPACE character.</li>

<li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">value</var>.</li>
<li><p><a href=#strip-and-collapse-whitespace>Strip and collapse whitespace</a> in <var title="">value</var>.</li>

<li><p>Return <var title="">value</var>.</li>

Expand Down Expand Up @@ -50795,14 +50798,11 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmleleme
element's <a href=#concept-option-index title=concept-option-index>index</a>.</p>

<p>The <dfn id=dom-option-text title=dom-option-text><code>text</code></dfn> IDL attribute, on getting, must return
the concatenation of <a href=#concept-cd-data title=concept-cd-data>data</a> of all the <code><a href=#text>Text</a></code> node
descendants of the <code><a href=#the-option-element>option</a></code> element, in <a href=#tree-order>tree order</a>, excluding any that are
descendants of descendants of the <code><a href=#the-option-element>option</a></code> element that are themselves
<code><a href=#the-script-element>script</a></code> elements in the <a href=#html-namespace-0>HTML namespace</a> or <code title="">script</code>
elements in the <a href=#svg-namespace>SVG namespace</a>, with <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing
whitespace">leading and trailing whitespace stripped</a>, and with any sequences of two or more
<a href=#space-character title="space character">space characters</a> replaced by a single U+0020 SPACE
character.</p>
the result of <a href=#strip-and-collapse-whitespace title="strip and collapse whitespace">stripping and collapsing
whitespace</a> from the concatenation of <a href=#concept-cd-data title=concept-cd-data>data</a> of all the
<code><a href=#text>Text</a></code> node descendants of the <code><a href=#the-option-element>option</a></code> element, in <a href=#tree-order>tree order</a>,
excluding any that are descendants of descendants of the <code><a href=#the-option-element>option</a></code> element that are
themselves <code><a href=#the-script-element>script</a></code> elements in the <a href=#html-namespace-0>HTML namespace</a> or <code title="">script</code> elements in the <a href=#svg-namespace>SVG namespace</a>.</p>

<p>On setting, the <code title=dom-option-text><a href=#dom-option-text>text</a></code> attribute must act as if the
<code><a href=#textcontent>textContent</a></code> IDL attribute on the element had been set to the new value.</p>
Expand Down
26 changes: 12 additions & 14 deletions source
Expand Up @@ -3076,6 +3076,11 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
user agent must remove all <span title="space character">space characters</span> that are at the
start or end of the string.</p>

<p>When a user agent is to <dfn>strip and collapse whitespace</dfn> in a string, it must replace
any sequence of one or more consecutive <span title="space character">space characters</span> in
that string with a single U+0020 SPACE character, and then <span>strip leading and trailing
whitespace</span> from that string.</p>

<p>When a user agent has to <dfn>strictly split a string</dfn> on a particular delimiter character
<var title="">delimiter</var>, it must use the following algorithm:</p>

Expand Down Expand Up @@ -8353,12 +8358,7 @@ partial /*sealed*/ interface <dfn>Document</dfn> {
the empty string if <span>the <code>title</code> element</span> is
null.</p></li>

<li><p>Replace any sequence of one or more consecutive <span
title="space character">space characters</span> in <var
title="">value</var> with a single U+0020 SPACE character.</p></li>

<li><p><span>Strip leading and trailing whitespace</span> from <var
title="">value</var>.</p></li>
<li><p><span>Strip and collapse whitespace</span> in <var title="">value</var>.</p></li>

<li><p>Return <var title="">value</var>.</p></li>

Expand Down Expand Up @@ -60607,14 +60607,12 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
element's <span title="concept-option-index">index</span>.</p>

<p>The <dfn title="dom-option-text"><code>text</code></dfn> IDL attribute, on getting, must return
the concatenation of <span title="concept-cd-data">data</span> of all the <code>Text</code> node
descendants of the <code>option</code> element, in <span>tree order</span>, excluding any that are
descendants of descendants of the <code>option</code> element that are themselves
<code>script</code> elements in the <span>HTML namespace</span> or <code title="">script</code>
elements in the <span>SVG namespace</span>, with <span title="strip leading and trailing
whitespace">leading and trailing whitespace stripped</span>, and with any sequences of two or more
<span title="space character">space characters</span> replaced by a single U+0020 SPACE
character.</p>
the result of <span title="strip and collapse whitespace">stripping and collapsing
whitespace</span> from the concatenation of <span title="concept-cd-data">data</span> of all the
<code>Text</code> node descendants of the <code>option</code> element, in <span>tree order</span>,
excluding any that are descendants of descendants of the <code>option</code> element that are
themselves <code>script</code> elements in the <span>HTML namespace</span> or <code
title="">script</code> elements in the <span>SVG namespace</span>.</p>

<p>On setting, the <code title="dom-option-text">text</code> attribute must act as if the
<code>textContent</code> IDL attribute on the element had been set to the new value.</p>
Expand Down

0 comments on commit 3d07406

Please sign in to comment.