Skip to content

Commit

Permalink
[giow] (3) Update document.title to work like textContent (also defin…
Browse files Browse the repository at this point in the history
…es how things work with mutation observers)

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

git-svn-id: http://svn.whatwg.org/webapps@8404 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 16, 2014
1 parent 0971aa8 commit cf735b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
16 changes: 7 additions & 9 deletions complete.html
Expand Up @@ -8772,6 +8772,8 @@ <h4 id=resource-metadata-management><span class=secno>3.1.2 </span><dfn>Resource

<h4 id=dom-tree-accessors><span class=secno>3.1.3 </span><dfn>DOM tree accessors</dfn></h4>

<!--CLEANUP-->

<p><dfn id=the-html-element-0>The <code>html</code> element</dfn> of a document is the
document's root element, if there is one and it's an
<code><a href=#the-html-element>html</a></code> element, or null otherwise.</p>
Expand Down Expand Up @@ -8832,8 +8834,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.3 </span><dfn>DOM tree accessors

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

</ol><p>On setting, the following algorithm must be run. Mutation events
must be fired as appropriate.</p>
</ol><p>On setting, the following algorithm must be run.</p>

<ol><li><p>If the <a href=#root-element>root element</a> is an <code><a href=#svg>svg</a></code>
element in the "<code title="">http://www.w3.org/2000/svg</code>"
Expand All @@ -8847,15 +8848,12 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.3 </span><dfn>DOM tree accessors
attribute must do nothing. Stop the algorithm here.</li>

<li>If <a href=#the-title-element-0>the <code>title</code> element</a> is null, then a
new <code><a href=#the-title-element>title</a></code> element must be created and appended to
<a href=#the-head-element-0>the <code>head</code> element</a>. Let <var title="">element</var> be that element. Otherwise, let <var title="">element</var> be <a href=#the-title-element-0>the <code>title</code>
new <code><a href=#the-title-element>title</a></code> element must be created and <a href=#concept-node-append title=concept-node-append>appended</a> to
<a href=#the-head-element-0>the <code>head</code> element</a>; let <var title="">element</var> be the newly created element. Otherwise, let <var title="">element</var> be <a href=#the-title-element-0>the <code>title</code>
element</a>.</li>

<li>The children of <var title="">element</var> (if any) must all
be removed.</li>

<li>A single <code><a href=#text>Text</a></code> node whose data is the new value
being assigned must be appended to <var title="">element</var>.</li>
<li><p>Act as if the <code><a href=#textcontent>textContent</a></code> IDL attribute of <var title="">element</var> was
set to the new value being assigned.</li>

</ol><p>The <code title=dom-document-title><a href=#document.title>title</a></code> IDL attribute
defined above must replace the attribute of the same name on the
Expand Down
16 changes: 7 additions & 9 deletions index
Expand Up @@ -8772,6 +8772,8 @@ partial /*sealed*/ interface <dfn id=document>Document</dfn> {

<h4 id=dom-tree-accessors><span class=secno>3.1.3 </span><dfn>DOM tree accessors</dfn></h4>

<!--CLEANUP-->

<p><dfn id=the-html-element-0>The <code>html</code> element</dfn> of a document is the
document's root element, if there is one and it's an
<code><a href=#the-html-element>html</a></code> element, or null otherwise.</p>
Expand Down Expand Up @@ -8832,8 +8834,7 @@ partial /*sealed*/ interface <dfn id=document>Document</dfn> {

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

</ol><p>On setting, the following algorithm must be run. Mutation events
must be fired as appropriate.</p>
</ol><p>On setting, the following algorithm must be run.</p>

<ol><li><p>If the <a href=#root-element>root element</a> is an <code><a href=#svg>svg</a></code>
element in the "<code title="">http://www.w3.org/2000/svg</code>"
Expand All @@ -8847,15 +8848,12 @@ partial /*sealed*/ interface <dfn id=document>Document</dfn> {
attribute must do nothing. Stop the algorithm here.</li>

<li>If <a href=#the-title-element-0>the <code>title</code> element</a> is null, then a
new <code><a href=#the-title-element>title</a></code> element must be created and appended to
<a href=#the-head-element-0>the <code>head</code> element</a>. Let <var title="">element</var> be that element. Otherwise, let <var title="">element</var> be <a href=#the-title-element-0>the <code>title</code>
new <code><a href=#the-title-element>title</a></code> element must be created and <a href=#concept-node-append title=concept-node-append>appended</a> to
<a href=#the-head-element-0>the <code>head</code> element</a>; let <var title="">element</var> be the newly created element. Otherwise, let <var title="">element</var> be <a href=#the-title-element-0>the <code>title</code>
element</a>.</li>

<li>The children of <var title="">element</var> (if any) must all
be removed.</li>

<li>A single <code><a href=#text>Text</a></code> node whose data is the new value
being assigned must be appended to <var title="">element</var>.</li>
<li><p>Act as if the <code><a href=#textcontent>textContent</a></code> IDL attribute of <var title="">element</var> was
set to the new value being assigned.</li>

</ol><p>The <code title=dom-document-title><a href=#document.title>title</a></code> IDL attribute
defined above must replace the attribute of the same name on the
Expand Down
19 changes: 8 additions & 11 deletions source
Expand Up @@ -8475,6 +8475,8 @@ partial /*sealed*/ interface <dfn>Document</dfn> {

<h4><dfn>DOM tree accessors</dfn></h4>

<!--CLEANUP-->

<p><dfn>The <code>html</code> element</dfn> of a document is the
document's root element, if there is one and it's an
<code>html</code> element, or null otherwise.</p>
Expand Down Expand Up @@ -8553,8 +8555,7 @@ partial /*sealed*/ interface <dfn>Document</dfn> {

</ol>

<p>On setting, the following algorithm must be run. Mutation events
must be fired as appropriate.</p>
<p>On setting, the following algorithm must be run.</p>

<ol>

Expand All @@ -8571,18 +8572,14 @@ partial /*sealed*/ interface <dfn>Document</dfn> {
attribute must do nothing. Stop the algorithm here.</li>

<li>If <span>the <code>title</code> element</span> is null, then a
new <code>title</code> element must be created and appended to
<span>the <code>head</code> element</span>. Let <var
data-x="">element</var> be that element. Otherwise, let <var
new <code>title</code> element must be created and <span data-x="concept-node-append">appended</span> to
<span>the <code>head</code> element</span>; let <var
data-x="">element</var> be the newly created element. Otherwise, let <var
data-x="">element</var> be <span>the <code>title</code>
element</span>.</li>

<li>The children of <var data-x="">element</var> (if any) must all
be removed.</li>

<li>A single <code>Text</code> node whose data is the new value
being assigned must be appended to <var
data-x="">element</var>.</li>
<li><p>Act as if the <code>textContent</code> IDL attribute of <var data-x="">element</var> was
set to the new value being assigned.</p></li>

</ol>

Expand Down

0 comments on commit cf735b8

Please sign in to comment.