[html5] r8559 - [giow] (3) Define document.title in an SVG context since apparently that's gone [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Apr 1 11:58:34 PDT 2014


Author: ianh
Date: 2014-04-01 11:58:23 -0700 (Tue, 01 Apr 2014)
New Revision: 8559

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Define document.title in an SVG context since apparently that's gone out of SVG now.
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2014-04-01 04:40:24 UTC (rev 8558)
+++ complete.html	2014-04-01 18:58:23 UTC (rev 8559)
@@ -8794,13 +8794,12 @@
   <hr><dl class=domintro><dt><var title="">document</var> . <code title=dom-document-title><a href=#document.title>title</a></code> [ = <var title="">value</var> ]</dt>
    <dd>
 
-    <p>Returns the document's title, as given by <a href=#the-title-element-0>the <code>title</code> element</a>.</p>
+    <p>Returns the document's title, as given by <a href=#the-title-element-0>the <code>title</code> element</a> for
+    HTML and as given by the SVG <code title="">title</code> element for SVG.</p>
 
-    <p>Can be set, to update the document's title. If there is no <a href=#the-head-element-0 title="the head
-    element"><code>head</code> element</a>, the new value is ignored.</p>
+    <p>Can be set, to update the document's title. If there is no appropriate element to update, the
+    new value is ignored.</p>
 
-    <p>In SVG documents, the <code>SVGDocument</code> interface's <code title=dom-svg-title>title</code> attribute takes precedence.</p>
-
    </dd>
 
   </dl><p><dfn id=the-title-element-0>The <code>title</code> element</dfn> of a document is the first <code><a href=#the-title-element>title</a></code> element
@@ -8811,9 +8810,10 @@
   <p>The <dfn id=document.title title=dom-document-title><code>title</code></dfn> attribute
   must, on getting, run the following algorithm:</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>" namespace, and the user agent supports SVG, then
-   return the value that would have been returned by the IDL attribute of the same name on the
-   <code>SVGDocument</code> interface. <a href=#refsSVG>[SVG]</a></li>
+  <ol><li><p>If the <a href=#root-element>root element</a> is an <code><a href=#svg>svg</a></code> element in the <a href=#svg-namespace>SVG
+   namespace</a>, then let <var title="">value</var> be a concatenation of the data of all the
+   child <code><a href=#text>Text</a></code> nodes of the first <code title="">title</code> element in the <a href=#svg-namespace>SVG
+   namespace</a> that is a child of the <a href=#root-element>root element</a>. <a href=#refsSVG>[SVG]</a></li>
 
    <li><p>Otherwise, let <var title="">value</var> be a concatenation of the data of all the child
    <code><a href=#text>Text</a></code> nodes of <a href=#the-title-element-0>the <code>title</code> element</a>, in <a href=#tree-order>tree
@@ -8824,30 +8824,52 @@
 
    <li><p>Return <var title="">value</var>.</li>
 
-  </ol><p>On setting, the following algorithm must be run.</p>
+  </ol><p>On setting, the steps corresponding to the first matching condition in the following list 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>" namespace, and the user agent supports SVG, then the
-   setter must act as if it was the setter for the IDL attribute of the same name on the
-   <code><a href=#document>Document</a></code> interface defined by the SVG specification. Stop the algorithm here. <a href=#refsSVG>[SVG]</a></li>
+  <dl class=switch><dt>If the <a href=#root-element>root element</a> is an <code><a href=#svg>svg</a></code> element in the <a href=#svg-namespace>SVG
+   namespace</a> <a href=#refsSVG>[SVG]</a></dt>
 
-   <li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is null and <a href=#the-head-element-0>the <code>head</code>
-   element</a> is null, then the attribute must do nothing. Stop the algorithm here.</li>
+   <dd>
 
-   <li><p>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 <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>
+    <ol><li><p>Let <var title="">element</var> be the first <code title="">title</code> element in
+     the <a href=#svg-namespace>SVG namespace</a> that is a child of the <a href=#root-element>root element</a>, if any. If
+     there isn't one, create a <code title="">title</code> element in the <a href=#svg-namespace>SVG
+     namespace</a>, append it to the <a href=#root-element>root element</a>, and let <var title="">element</var> be that element. <a href=#refsSVG>[SVG]</a></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>
+     <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 <code><a href=#document>Document</a></code> interface defined by the SVG specification
-  when the user agent supports both HTML and SVG. <a href=#refsSVG>[SVG]</a></p>
+    </ol></dd>
 
-  </div>
+   <dt>If the <a href=#root-element>root element</a> is in the <a href=#html-namespace-0>HTML namespace</a></dt>
 
+   <dd>
+
+    <ol><li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is null and <a href=#the-head-element-0>the <code>head</code>
+     element</a> is null, then abort these steps.</li>
+
+     <li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is null, then create a new
+     <code><a href=#the-title-element>title</a></code> element and <a href=#concept-node-append title=concept-node-append>append</a> it to <a href=#the-head-element-0>the
+     <code>head</code> element</a>, and 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><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></dd>
+
+   <dt>Otherwise</dt>
+
+   <dd>
+
+    <p>Do nothing.</p>
+
+   </dd>
+
+  </dl></div>
+
   <hr><dl class=domintro><dt><var title="">document</var> . <code title=dom-document-body><a href=#dom-document-body>body</a></code> [ = <var title="">value</var> ]</dt>
    <dd>
 

Modified: index
===================================================================
--- index	2014-04-01 04:40:24 UTC (rev 8558)
+++ index	2014-04-01 18:58:23 UTC (rev 8559)
@@ -8794,13 +8794,12 @@
   <hr><dl class=domintro><dt><var title="">document</var> . <code title=dom-document-title><a href=#document.title>title</a></code> [ = <var title="">value</var> ]</dt>
    <dd>
 
-    <p>Returns the document's title, as given by <a href=#the-title-element-0>the <code>title</code> element</a>.</p>
+    <p>Returns the document's title, as given by <a href=#the-title-element-0>the <code>title</code> element</a> for
+    HTML and as given by the SVG <code title="">title</code> element for SVG.</p>
 
-    <p>Can be set, to update the document's title. If there is no <a href=#the-head-element-0 title="the head
-    element"><code>head</code> element</a>, the new value is ignored.</p>
+    <p>Can be set, to update the document's title. If there is no appropriate element to update, the
+    new value is ignored.</p>
 
-    <p>In SVG documents, the <code>SVGDocument</code> interface's <code title=dom-svg-title>title</code> attribute takes precedence.</p>
-
    </dd>
 
   </dl><p><dfn id=the-title-element-0>The <code>title</code> element</dfn> of a document is the first <code><a href=#the-title-element>title</a></code> element
@@ -8811,9 +8810,10 @@
   <p>The <dfn id=document.title title=dom-document-title><code>title</code></dfn> attribute
   must, on getting, run the following algorithm:</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>" namespace, and the user agent supports SVG, then
-   return the value that would have been returned by the IDL attribute of the same name on the
-   <code>SVGDocument</code> interface. <a href=#refsSVG>[SVG]</a></li>
+  <ol><li><p>If the <a href=#root-element>root element</a> is an <code><a href=#svg>svg</a></code> element in the <a href=#svg-namespace>SVG
+   namespace</a>, then let <var title="">value</var> be a concatenation of the data of all the
+   child <code><a href=#text>Text</a></code> nodes of the first <code title="">title</code> element in the <a href=#svg-namespace>SVG
+   namespace</a> that is a child of the <a href=#root-element>root element</a>. <a href=#refsSVG>[SVG]</a></li>
 
    <li><p>Otherwise, let <var title="">value</var> be a concatenation of the data of all the child
    <code><a href=#text>Text</a></code> nodes of <a href=#the-title-element-0>the <code>title</code> element</a>, in <a href=#tree-order>tree
@@ -8824,30 +8824,52 @@
 
    <li><p>Return <var title="">value</var>.</li>
 
-  </ol><p>On setting, the following algorithm must be run.</p>
+  </ol><p>On setting, the steps corresponding to the first matching condition in the following list 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>" namespace, and the user agent supports SVG, then the
-   setter must act as if it was the setter for the IDL attribute of the same name on the
-   <code><a href=#document>Document</a></code> interface defined by the SVG specification. Stop the algorithm here. <a href=#refsSVG>[SVG]</a></li>
+  <dl class=switch><dt>If the <a href=#root-element>root element</a> is an <code><a href=#svg>svg</a></code> element in the <a href=#svg-namespace>SVG
+   namespace</a> <a href=#refsSVG>[SVG]</a></dt>
 
-   <li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is null and <a href=#the-head-element-0>the <code>head</code>
-   element</a> is null, then the attribute must do nothing. Stop the algorithm here.</li>
+   <dd>
 
-   <li><p>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 <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>
+    <ol><li><p>Let <var title="">element</var> be the first <code title="">title</code> element in
+     the <a href=#svg-namespace>SVG namespace</a> that is a child of the <a href=#root-element>root element</a>, if any. If
+     there isn't one, create a <code title="">title</code> element in the <a href=#svg-namespace>SVG
+     namespace</a>, append it to the <a href=#root-element>root element</a>, and let <var title="">element</var> be that element. <a href=#refsSVG>[SVG]</a></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>
+     <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 <code><a href=#document>Document</a></code> interface defined by the SVG specification
-  when the user agent supports both HTML and SVG. <a href=#refsSVG>[SVG]</a></p>
+    </ol></dd>
 
-  </div>
+   <dt>If the <a href=#root-element>root element</a> is in the <a href=#html-namespace-0>HTML namespace</a></dt>
 
+   <dd>
+
+    <ol><li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is null and <a href=#the-head-element-0>the <code>head</code>
+     element</a> is null, then abort these steps.</li>
+
+     <li><p>If <a href=#the-title-element-0>the <code>title</code> element</a> is null, then create a new
+     <code><a href=#the-title-element>title</a></code> element and <a href=#concept-node-append title=concept-node-append>append</a> it to <a href=#the-head-element-0>the
+     <code>head</code> element</a>, and 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><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></dd>
+
+   <dt>Otherwise</dt>
+
+   <dd>
+
+    <p>Do nothing.</p>
+
+   </dd>
+
+  </dl></div>
+
   <hr><dl class=domintro><dt><var title="">document</var> . <code title=dom-document-body><a href=#dom-document-body>body</a></code> [ = <var title="">value</var> ]</dt>
    <dd>
 

Modified: source
===================================================================
--- source	2014-04-01 04:40:24 UTC (rev 8558)
+++ source	2014-04-01 18:58:23 UTC (rev 8559)
@@ -8479,14 +8479,12 @@
    <dt><var data-x="">document</var> . <code data-x="dom-document-title">title</code> [ = <var data-x="">value</var> ]</dt>
    <dd>
 
-    <p>Returns the document's title, as given by <span>the <code>title</code> element</span>.</p>
+    <p>Returns the document's title, as given by <span>the <code>title</code> element</span> for
+    HTML and as given by the SVG <code data-x="">title</code> element for SVG.</p>
 
-    <p>Can be set, to update the document's title. If there is no <span data-x="the head
-    element"><code>head</code> element</span>, the new value is ignored.</p>
+    <p>Can be set, to update the document's title. If there is no appropriate element to update, the
+    new value is ignored.</p>
 
-    <p>In SVG documents, the <code>SVGDocument</code> interface's <code
-    data-x="dom-svg-title">title</code> attribute takes precedence.</p>
-
    </dd>
 
   </dl>
@@ -8501,10 +8499,11 @@
 
   <ol>
 
-   <li><p>If the <span>root element</span> is an <code>svg</code> element in the "<code
-   data-x="">http://www.w3.org/2000/svg</code>" namespace, and the user agent supports SVG, then
-   return the value that would have been returned by the IDL attribute of the same name on the
-   <code>SVGDocument</code> interface. <a href="#refsSVG">[SVG]</a></p></li>
+   <li><p>If the <span>root element</span> is an <code>svg</code> element in the <span>SVG
+   namespace</span>, then let <var data-x="">value</var> be a concatenation of the data of all the
+   child <code>Text</code> nodes of the first <code data-x="">title</code> element in the <span>SVG
+   namespace</span> that is a child of the <span>root element</span>. <a
+   href="#refsSVG">[SVG]</a></p></li>
 
    <li><p>Otherwise, let <var data-x="">value</var> be a concatenation of the data of all the child
    <code>Text</code> nodes of <span>the <code>title</code> element</span>, in <span>tree
@@ -8517,34 +8516,63 @@
 
   </ol>
 
-  <p>On setting, the following algorithm must be run.</p>
+  <p>On setting, the steps corresponding to the first matching condition in the following list must
+  be run:</p>
 
-  <ol>
+  <dl class="switch">
 
-   <li><p>If the <span>root element</span> is an <code>svg</code> element in the "<code
-   data-x="">http://www.w3.org/2000/svg</code>" namespace, and the user agent supports SVG, then the
-   setter must act as if it was the setter for the IDL attribute of the same name on the
-   <code>Document</code> interface defined by the SVG specification. Stop the algorithm here. <a
-   href="#refsSVG">[SVG]</a></p></li>
+   <dt>If the <span>root element</span> is an <code>svg</code> element in the <span>SVG
+   namespace</span> <a href="#refsSVG">[SVG]</a></dt>
 
-   <li><p>If <span>the <code>title</code> element</span> is null and <span>the <code>head</code>
-   element</span> is null, then the attribute must do nothing. Stop the algorithm here.</p></li>
+   <dd>
 
-   <li><p>If <span>the <code>title</code> element</span> is null, then a 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>.</p></li>
+    <ol>
 
-   <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>
+     <li><p>Let <var data-x="">element</var> be the first <code data-x="">title</code> element in
+     the <span>SVG namespace</span> that is a child of the <span>root element</span>, if any. If
+     there isn't one, create a <code data-x="">title</code> element in the <span>SVG
+     namespace</span>, append it to the <span>root element</span>, and let <var
+     data-x="">element</var> be that element. <a href="#refsSVG">[SVG]</a></p></li>
 
-  </ol>
+     <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>
 
-  <p>The <code data-x="dom-document-title">title</code> IDL attribute defined above must replace the
-  attribute of the same name on the <code>Document</code> interface defined by the SVG specification
-  when the user agent supports both HTML and SVG. <a href="#refsSVG">[SVG]</a></p>
+    </ol>
 
+   </dd>
+
+   <dt>If the <span>root element</span> is in the <span>HTML namespace</span></dt>
+
+   <dd>
+
+    <ol>
+
+     <li><p>If <span>the <code>title</code> element</span> is null and <span>the <code>head</code>
+     element</span> is null, then abort these steps.</p></li>
+
+     <li><p>If <span>the <code>title</code> element</span> is null, then create a new
+     <code>title</code> element and <span data-x="concept-node-append">append</span> it to <span>the
+     <code>head</code> element</span>, and 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>.</p></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>
+
+   </dd>
+
+   <dt>Otherwise</dt>
+
+   <dd>
+
+    <p>Do nothing.</p>
+
+   </dd>
+
+  </dl>
+
   </div>
 
   <hr>




More information about the Commit-Watchers mailing list