Skip to content

Commit

Permalink
[] (0) Make HTML's document.title play nice with SVG's document.title
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@866 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 5, 2007
1 parent a886c5b commit 1dccafd
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 9 deletions.
35 changes: 30 additions & 5 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -3220,15 +3220,34 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

<p>The <dfn id=document.title
title=dom-document-title><code>title</code></dfn> attribute must, on
getting, return a concatenation of the data of all the child <a
href="#text-node" title="text node">text nodes</a> of <a
href="#the-title1">the <code>title</code> element</a>, in tree order, or
the empty string if <a href="#the-title1">the <code>title</code>
element</a> is null.
getting, run the following algorithm:

<ol>
<li>
<p>If the <a href="#root-element">root element</a> is an <code>svg</code>
element in the "<code title="">http://www.w3.org/2000/svg</code>"
namespace, and the user agent supports SVG, then the getter must return
the value that would have been returned by the DOM attribute of the same
name on the <code>SVGDocument</code> interface.

<li>
<p>Otherwise, it must return a concatenation of the data of all the child
<a href="#text-node" title="text node">text nodes</a> of <a
href="#the-title1">the <code>title</code> element</a>, in tree order, or
the empty string if <a href="#the-title1">the <code>title</code>
element</a> is null.
</ol>

<p>On setting, the following algorithm must be run:

<ol>
<li>
<p>If the <a href="#root-element">root element</a> is an <code>svg</code>
element in the "<code title="">http://www.w3.org/2000/svg</code>"
namespace, and the user agent supports SVG, then the setter must defer
to the setter for the DOM attribute of the same name on the
<code>SVGDocument</code> interface. Stop the algorithm here.

<li>If <a href="#the-head0">the <code>head</code> element</a> is null,
then the attribute must do nothing. Stop the algorithm here.

Expand All @@ -3245,6 +3264,12 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
element</a>.
</ol>

<p>The <code title=dom-document-title><a
href="#document.title">title</a></code> attribute on the <code><a
href="#htmldocument">HTMLDocument</a></code> interface should shadow the
attribute of the same name on the <code>SVGDocument</code> interface when
the user agent supports both HTML and SVG.

<p><dfn id=the-body0>The body element</dfn> of a document is the first
child of <a href="#the-html0">the <code>html</code> element</a> that is
either a <code><a href="#body0">body</a></code> element or a
Expand Down
35 changes: 31 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -1746,23 +1746,44 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<code>html</code> element</span>, if there is one, or null
otherwise.</p>


<p><dfn>The <code>title</code> element</dfn> of a document is the
first <code>title</code> element that is a child of <span>the
<code>head</code> element</span>, if there is one, or null
otherwise.</p>

<p>The <dfn id="document.title"
title="dom-document-title"><code>title</code></dfn> attribute must,
on getting, return a concatenation of the data of all the child
<span title="text node">text nodes</span> of <span>the
<code>title</code> element</span>, in tree order, or the empty
string if <span>the <code>title</code> element</span> is null.</p>
on getting, run the following algorithm:</p>

<ol>

<li><p>If the <span>root element</span> is an <code>svg</code>
element in the "<code title="">http://www.w3.org/2000/svg</code>"
namespace, and the user agent supports SVG, then the getter must
return the value that would have been returned by the DOM attribute
of the same name on the <code>SVGDocument</code>
interface.</p></li>

<li><p>Otherwise, it must return a concatenation of the data of all
the child <span title="text node">text nodes</span> of <span>the
<code>title</code> element</span>, in tree order, or the empty
string if <span>the <code>title</code> element</span> is
null.</p></li>

</ol>

<p>On setting, the following algorithm must be run:</p>

<ol>

<li><p>If the <span>root element</span> is an <code>svg</code>
element in the "<code title="">http://www.w3.org/2000/svg</code>"
namespace, and the user agent supports SVG, then the setter must
defer to the setter for the DOM attribute of the same name on the
<code>SVGDocument</code> interface. Stop the algorithm
here.</p></li>

<li>If <span>the <code>head</code> element</span> is null, then the
attribute must do nothing. Stop the algorithm here.</li>

Expand All @@ -1779,6 +1800,12 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

</ol>

<p>The <code title="dom-document-title">title</code> attribute on
the <code>HTMLDocument</code> interface should shadow the attribute
of the same name on the <code>SVGDocument</code> interface when the
user agent supports both HTML and SVG.</p>


<p><dfn>The body element</dfn> of a document is the first child of
<span>the <code>html</code> element</span> that is either a
<code>body</code> element or a <code>frameset</code> element. If
Expand Down

0 comments on commit 1dccafd

Please sign in to comment.