Skip to content
Browse files

[giow] (2) Make HTMLDocument === Document.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14037

git-svn-id: http://svn.whatwg.org/webapps@6718 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent ec18727 commit 83f13eef1b41120b4b0f27ee58d716865141168c @Hixie Hixie committed
Showing with 97 additions and 149 deletions.
  1. +32 −49 complete.html
  2. +32 −49 index
  3. +33 −51 source
View
81 complete.html
@@ -2132,7 +2132,7 @@ <h3 id=a-quick-introduction-to-html><span class=secno>1.10 </span>A quick introd
<pre>&lt;<a href=#the-form-element>form</a> <a href=#attr-form-name title=attr-form-name>name</a>="main"&gt;
Result: &lt;<a href=#the-output-element>output</a> <a href=#attr-fe-name title=attr-fe-name>name</a>="result"&gt;&lt;/output&gt;
&lt;<a href=#the-script-element>script</a>&gt;
- <a href=#htmldocument title=HTMLDocument>document</a>.<a href=#dom-document-forms title=dom-document-forms>forms</a>.main.<a href=#dom-form-elements title=dom-form-elements>elements</a>.result.<a href=#dom-output-value title=dom-output-value>value</a> = 'Hello World';
+ <a href=#document title=Document>document</a>.<a href=#dom-document-forms title=dom-document-forms>forms</a>.main.<a href=#dom-form-elements title=dom-form-elements>elements</a>.result.<a href=#dom-output-value title=dom-output-value>value</a> = 'Hello World';
&lt;/script&gt;
&lt;/form&gt;</pre>
@@ -2142,7 +2142,7 @@ <h3 id=a-quick-introduction-to-html><span class=secno>1.10 </span>A quick introd
can have its "<code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code>"
attribute changed in several ways:</p>
- <pre>var a = <a href=#htmldocument title=HTMLDocument>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
+ <pre>var a = <a href=#document title=Document>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
a.<a href=#dom-a-href title=dom-a-href>href</a> = 'sample.html'; // change the destination URL of the link
a.<a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
@@ -9222,26 +9222,10 @@ <h3 id=documents><span class=secno>3.1 </span>Documents</h3>
</ol><h4 id=documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</h4>
- <p>All <code><a href=#document>Document</a></code> objects (in user agents implementing
- this specification) <span class=impl>must</span> also implement
- the <code><a href=#htmldocument>HTMLDocument</a></code> interface, available using
- binding-specific methods. (This is the case whether or not the
- document in question is an <a href=#html-documents title="HTML documents">HTML
- document</a> or indeed whether it contains any <a href=#html-elements>HTML
- elements</a> at all.) <code><a href=#document>Document</a></code> objects <span class=impl>must</span> also implement the document-level interface
- of any other namespaces that the UA supports.</p>
-
- <p class=example>For example, if an HTML implementation also
- supports SVG, then the <code><a href=#document>Document</a></code> object implements both
- <code><a href=#htmldocument>HTMLDocument</a></code> and <code>SVGDocument</code>.</p>
-
- <p class=note>Because the <code><a href=#htmldocument>HTMLDocument</a></code> interface is
- now obtained using binding-specific casting methods instead of
- simply being the primary interface of the document object, it is no
- longer defined as inheriting from <code><a href=#document>Document</a></code>.</p>
-
<pre class=idl>[OverrideBuiltins]
-interface <dfn id=htmldocument>HTMLDocument</dfn> {
+partial interface <a href=#document>Document</a> {
+ readonly attribute <code><a href=#document>Document</a></code> <a href=#htmldocument title=HTMLDocument>HTMLDocument</a>;
+
// <a href=#resource-metadata-management>resource metadata management</a>
[PutForwards=<a href=#dom-location-href title=dom-location-href>href</a>] readonly attribute <a href=#location>Location</a>? <a href=#dom-document-location title=dom-document-location>location</a>;
readonly attribute DOMString <a href=#dom-document-url title=dom-document-URL>URL</a>;
@@ -9268,7 +9252,7 @@ <h3 id=documents><span class=secno>3.1 </span>Documents</h3>
<!--CSSREF--> readonly attribute <a href=#domelementmap>DOMElementMap</a> <a href=#dom-document-csselementmap title=dom-document-cssElementMap>cssElementMap</a>;<!--CSSREF-->
// <a href=#dynamic-markup-insertion>dynamic markup insertion</a>
- <a href=#htmldocument>HTMLDocument</a> <a href=#dom-document-open title=dom-document-open>open</a>(optional DOMString type, optional DOMString replace);
+ <a href=#document>Document</a> <a href=#dom-document-open title=dom-document-open>open</a>(optional DOMString type, optional DOMString replace);
<a href=#windowproxy>WindowProxy</a> <a href=#dom-document-open title=dom-document-open>open</a>(DOMString url, DOMString name, DOMString features, optional boolean replace);
void <a href=#dom-document-close title=dom-document-close>close</a>();
void <a href=#dom-document-write title=dom-document-write>write</a>(DOMString... text);
@@ -9346,12 +9330,10 @@ <h3 id=documents><span class=secno>3.1 </span>Documents</h3>
// special <a href=#event-handler-idl-attributes>event handler IDL attributes</a> that only apply to Document objects
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
-};
-<a href=#document>Document</a> implements <a href=#htmldocument>HTMLDocument</a>;</pre>
+};</pre>
- <p>Since the <code><a href=#htmldocument>HTMLDocument</a></code> interface holds methods and
- attributes related to a number of disparate features, the members of
- this interface are described in various different sections.</p>
+ <p>The <dfn id=htmldocument><code>HTMLDocument</code></dfn> IDL attribute must
+ return the <code><a href=#document>Document</a></code> object on which it is called.</p>
<h4 id=security-document><span class=secno>3.1.2 </span>Security</h4>
@@ -9628,8 +9610,9 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
<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
- defer to the setter for the IDL attribute of the same name on the
- <code>SVGDocument</code> interface. Stop the algorithm here. <a href=#refsSVG>[SVG]</a></li>
+ 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>
<li>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
@@ -9646,10 +9629,10 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
<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>
- </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. <a href=#refsSVG>[SVG]</a></p>
+ </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>
</div>
@@ -9868,7 +9851,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
<div class=impl>
- <hr><p>The <code><a href=#htmldocument>HTMLDocument</a></code> interface <span title="support
+ <hr><p>The <code><a href=#document>Document</a></code> interface <span title="support
named properties">supports named properties</span>. The
<a href=#supported-property-names>supported property names</a> at any moment consist of the
values of the <code title=attr-name>name</code> content attributes
@@ -9889,7 +9872,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
elements in the <code><a href=#document>Document</a></code> that have both <code title=attr-name>name</code> content attributes and <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes.</p>
<p>To <a href=#determine-the-value-of-a-named-property>determine the value of a named property</a> <var title="">name</var> when <dfn id=dom-document-nameditem title=dom-document-namedItem>the
- <code>HTMLDocument</code> object is indexed for property
+ <code>Document</code> object is indexed for property
retrieval</dfn>, the user agent must return the value obtained using
the following steps:</p>
@@ -9959,7 +9942,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
</div>
<hr><p class=note>The <code title=dom-document-dir><a href=#dom-document-dir>dir</a></code>
- attribute on the <code><a href=#htmldocument>HTMLDocument</a></code> interface is defined
+ attribute on the <code><a href=#document>Document</a></code> interface is defined
along with the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> content
attribute.</p>
@@ -10884,7 +10867,7 @@ <h5 id=the-dir-attribute><span class=secno>3.2.3.5 </span>The <dfn title=attr-di
<a href=#limited-to-only-known-values>limited to only known values</a>.</p>
<p>The <dfn id=dom-document-dir title=dom-document-dir><code>dir</code></dfn> IDL
- attribute on <code><a href=#htmldocument>HTMLDocument</a></code> objects must
+ attribute on <code><a href=#document>Document</a></code> objects must
<a href=#reflect>reflect</a> the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> content
attribute of <a href=#the-html-element-0>the <code>html</code> element</a>, if any,
<a href=#limited-to-only-known-values>limited to only known values</a>. If there is no such
@@ -13066,10 +13049,10 @@ <h4 id=opening-the-input-stream><span class=secno>3.4.1 </span>Opening the input
tasks</a> or <a href=#completely-loaded>completely loaded</a>.</p>
<p>When called with three or more arguments, the <code title=dom-document-open><a href=#dom-document-open>open()</a></code> method on the
- <code><a href=#htmldocument>HTMLDocument</a></code> object must call the <code title=dom-open><a href=#dom-open>open()</a></code> method on the <code><a href=#window>Window</a></code>
- object of the <code><a href=#htmldocument>HTMLDocument</a></code> object, with the same
+ <code><a href=#document>Document</a></code> object must call the <code title=dom-open><a href=#dom-open>open()</a></code> method on the <code><a href=#window>Window</a></code>
+ object of the <code><a href=#document>Document</a></code> object, with the same
arguments as the original call to the <code title=dom-document-open><a href=#dom-document-open>open()</a></code> method, and return whatever
- that method returned. If the <code><a href=#htmldocument>HTMLDocument</a></code> object has no
+ that method returned. If the <code><a href=#document>Document</a></code> object has no
<code><a href=#window>Window</a></code> object, then the method must throw an
<code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception.</p>
@@ -54359,7 +54342,7 @@ <h4 id=commands><span class=secno>4.11.5 </span>Commands</h4>
</dl><div class=impl>
<p>The <dfn id=dom-document-commands title=dom-document-commands><code>commands</code></dfn> attribute
- of the document's <code><a href=#htmldocument>HTMLDocument</a></code> interface must return an
+ of the document's <code><a href=#document>Document</a></code> interface must return an
<code><a href=#htmlcollection>HTMLCollection</a></code> rooted at the <code><a href=#document>Document</a></code>
node, whose filter matches only elements that <a href=#concept-command title=concept-command>define commands</a> and have <a href=#command-facet-id title=command-facet-ID>IDs</a>.</p>
@@ -62595,7 +62578,7 @@ <h3 id=the-window-object><span class=secno>6.2 </span>The <code><a href=#window>
context</a>'s <a href=#active-document>active document</a>.</p>
<p>The <dfn id=dom-document-defaultview title=dom-document-defaultView><code>defaultView</code></dfn> IDL
- attribute of the <code><a href=#htmldocument>HTMLDocument</a></code> interface must return the
+ attribute of the <code><a href=#document>Document</a></code> interface must return the
<code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>'s
<code><a href=#windowproxy>WindowProxy</a></code> object, if there is one, or null
otherwise.</p>
@@ -64365,7 +64348,7 @@ <h4 id=the-location-interface><span class=secno>6.4.3 </span>The <code><a href=#
</dl><div class=impl>
<p>The <dfn id=dom-document-location title=dom-document-location><code>location</code></dfn> attribute
- of the <code><a href=#htmldocument>HTMLDocument</a></code> interface must return the
+ of the <code><a href=#document>Document</a></code> interface must return the
<code><a href=#location>Location</a></code> object for that <code><a href=#document>Document</a></code> object,
if it is in a <a href=#browsing-context>browsing context</a>, and null otherwise.</p>
@@ -69625,7 +69608,7 @@ <h5 id=event-handlers-on-elements,-document-objects,-and-window-objects><span cl
</table><p class=note>The <code title=handler-window-onerror><a href=#handler-window-onerror>onerror</a></code>
handler is also used for <a href=#runtime-script-errors>reporting script errors</a>.</p>
- <hr><!-- this guy is only on HTMLDocument and not on HTMLElement because
+ <hr><!-- this guy is only on Document and not on HTMLElement because
otherwise HTMLScriptElement would have it and that causes
compatibility issues since IE fires readystatechange events on
<script>, not load events, and we can't fire both, and some sites
@@ -72012,13 +71995,13 @@ <h4 id=document-level-focus-apis><span class=secno>8.3.3 </span>Document-level f
</dl><div class=impl>
<p>The <dfn id=dom-document-activeelement title=dom-document-activeElement><code>activeElement</code></dfn>
- attribute on <code><a href=#htmldocument>HTMLDocument</a></code> objects must return the
+ attribute on <code><a href=#document>Document</a></code> objects must return the
element in the document that is focused. If no element in the
<code><a href=#document>Document</a></code> is focused, this must return <a href=#the-body-element-0>the body
element</a>.</p>
<p>The <dfn id=dom-document-hasfocus title=dom-document-hasFocus><code>hasFocus()</code></dfn> method
- on <code><a href=#htmldocument>HTMLDocument</a></code> objects must return true if the
+ on <code><a href=#document>Document</a></code> objects must return true if the
<code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a> is focused,
and all its <a href=#ancestor-browsing-context title="ancestor browsing context">ancestor
browsing contexts</a> are also focused, and the <a href=#top-level-browsing-context>top-level
@@ -97466,7 +97449,7 @@ <h4 id=other-elements,-attributes-and-apis><span class=secno>16.3.4 </span>Other
spec, albeit as obsolete, and then we say that only elements not
defined in this spec use HTMLUnknownElement. -->
- <hr><pre class=idl>partial interface <a href=#htmldocument>HTMLDocument</a> {
+ <hr><pre class=idl>partial interface <a href=#document>Document</a> {
[TreatNullAs=EmptyString] attribute DOMString <a href=#dom-document-fgcolor title=dom-document-fgColor>fgColor</a>;
[TreatNullAs=EmptyString] attribute DOMString <a href=#dom-document-linkcolor title=dom-document-linkColor>linkColor</a>;
[TreatNullAs=EmptyString] attribute DOMString <a href=#dom-document-vlinkcolor title=dom-document-vlinkColor>vlinkColor</a>;
@@ -102645,8 +102628,8 @@ <h3 class="no-num">Reflecting IDL attributes</h3>
library.onload = function() {
var sound1 = library.getAudio("sound1.wav"); // returns an Audio object
var image1 = library.getImage("image1.png"); // returns an HTMLImageElement
- var doc1 = library.getXMLDocument("doc1.xml"); // returns a Document
- var doc2 = library.getHTMLDocument("doc1.html"); // returns an HTMLDocument
+ var doc1 = library.getXMLDocument("doc1.xml"); // returns a Document (XML Document mode)
+ var doc2 = library.getHTMLDocument("doc1.html"); // returns a Document (HTML Document mode)
}
or:
var library = new ResourceLoader("data.zip");
View
81 index
@@ -2132,7 +2132,7 @@
<pre>&lt;<a href=#the-form-element>form</a> <a href=#attr-form-name title=attr-form-name>name</a>="main"&gt;
Result: &lt;<a href=#the-output-element>output</a> <a href=#attr-fe-name title=attr-fe-name>name</a>="result"&gt;&lt;/output&gt;
&lt;<a href=#the-script-element>script</a>&gt;
- <a href=#htmldocument title=HTMLDocument>document</a>.<a href=#dom-document-forms title=dom-document-forms>forms</a>.main.<a href=#dom-form-elements title=dom-form-elements>elements</a>.result.<a href=#dom-output-value title=dom-output-value>value</a> = 'Hello World';
+ <a href=#document title=Document>document</a>.<a href=#dom-document-forms title=dom-document-forms>forms</a>.main.<a href=#dom-form-elements title=dom-form-elements>elements</a>.result.<a href=#dom-output-value title=dom-output-value>value</a> = 'Hello World';
&lt;/script&gt;
&lt;/form&gt;</pre>
@@ -2142,7 +2142,7 @@
can have its "<code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code>"
attribute changed in several ways:</p>
- <pre>var a = <a href=#htmldocument title=HTMLDocument>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
+ <pre>var a = <a href=#document title=Document>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
a.<a href=#dom-a-href title=dom-a-href>href</a> = 'sample.html'; // change the destination URL of the link
a.<a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
@@ -9222,26 +9222,10 @@ interface <dfn id=transferable>Transferable</dfn> { };</pre>
</ol><h4 id=documents-in-the-dom><span class=secno>3.1.1 </span>Documents in the DOM</h4>
- <p>All <code><a href=#document>Document</a></code> objects (in user agents implementing
- this specification) <span class=impl>must</span> also implement
- the <code><a href=#htmldocument>HTMLDocument</a></code> interface, available using
- binding-specific methods. (This is the case whether or not the
- document in question is an <a href=#html-documents title="HTML documents">HTML
- document</a> or indeed whether it contains any <a href=#html-elements>HTML
- elements</a> at all.) <code><a href=#document>Document</a></code> objects <span class=impl>must</span> also implement the document-level interface
- of any other namespaces that the UA supports.</p>
-
- <p class=example>For example, if an HTML implementation also
- supports SVG, then the <code><a href=#document>Document</a></code> object implements both
- <code><a href=#htmldocument>HTMLDocument</a></code> and <code>SVGDocument</code>.</p>
-
- <p class=note>Because the <code><a href=#htmldocument>HTMLDocument</a></code> interface is
- now obtained using binding-specific casting methods instead of
- simply being the primary interface of the document object, it is no
- longer defined as inheriting from <code><a href=#document>Document</a></code>.</p>
-
<pre class=idl>[OverrideBuiltins]
-interface <dfn id=htmldocument>HTMLDocument</dfn> {
+partial interface <a href=#document>Document</a> {
+ readonly attribute <code><a href=#document>Document</a></code> <a href=#htmldocument title=HTMLDocument>HTMLDocument</a>;
+
// <a href=#resource-metadata-management>resource metadata management</a>
[PutForwards=<a href=#dom-location-href title=dom-location-href>href</a>] readonly attribute <a href=#location>Location</a>? <a href=#dom-document-location title=dom-document-location>location</a>;
readonly attribute DOMString <a href=#dom-document-url title=dom-document-URL>URL</a>;
@@ -9268,7 +9252,7 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
<!--CSSREF--> readonly attribute <a href=#domelementmap>DOMElementMap</a> <a href=#dom-document-csselementmap title=dom-document-cssElementMap>cssElementMap</a>;<!--CSSREF-->
// <a href=#dynamic-markup-insertion>dynamic markup insertion</a>
- <a href=#htmldocument>HTMLDocument</a> <a href=#dom-document-open title=dom-document-open>open</a>(optional DOMString type, optional DOMString replace);
+ <a href=#document>Document</a> <a href=#dom-document-open title=dom-document-open>open</a>(optional DOMString type, optional DOMString replace);
<a href=#windowproxy>WindowProxy</a> <a href=#dom-document-open title=dom-document-open>open</a>(DOMString url, DOMString name, DOMString features, optional boolean replace);
void <a href=#dom-document-close title=dom-document-close>close</a>();
void <a href=#dom-document-write title=dom-document-write>write</a>(DOMString... text);
@@ -9346,12 +9330,10 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
// special <a href=#event-handler-idl-attributes>event handler IDL attributes</a> that only apply to Document objects
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
-};
-<a href=#document>Document</a> implements <a href=#htmldocument>HTMLDocument</a>;</pre>
+};</pre>
- <p>Since the <code><a href=#htmldocument>HTMLDocument</a></code> interface holds methods and
- attributes related to a number of disparate features, the members of
- this interface are described in various different sections.</p>
+ <p>The <dfn id=htmldocument><code>HTMLDocument</code></dfn> IDL attribute must
+ return the <code><a href=#document>Document</a></code> object on which it is called.</p>
<h4 id=security-document><span class=secno>3.1.2 </span>Security</h4>
@@ -9628,8 +9610,9 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
<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
- defer to the setter for the IDL attribute of the same name on the
- <code>SVGDocument</code> interface. Stop the algorithm here. <a href=#refsSVG>[SVG]</a></li>
+ 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>
<li>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
@@ -9646,10 +9629,10 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
<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>
- </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. <a href=#refsSVG>[SVG]</a></p>
+ </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>
</div>
@@ -9868,7 +9851,7 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
<div class=impl>
- <hr><p>The <code><a href=#htmldocument>HTMLDocument</a></code> interface <span title="support
+ <hr><p>The <code><a href=#document>Document</a></code> interface <span title="support
named properties">supports named properties</span>. The
<a href=#supported-property-names>supported property names</a> at any moment consist of the
values of the <code title=attr-name>name</code> content attributes
@@ -9889,7 +9872,7 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
elements in the <code><a href=#document>Document</a></code> that have both <code title=attr-name>name</code> content attributes and <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes.</p>
<p>To <a href=#determine-the-value-of-a-named-property>determine the value of a named property</a> <var title="">name</var> when <dfn id=dom-document-nameditem title=dom-document-namedItem>the
- <code>HTMLDocument</code> object is indexed for property
+ <code>Document</code> object is indexed for property
retrieval</dfn>, the user agent must return the value obtained using
the following steps:</p>
@@ -9959,7 +9942,7 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
</div>
<hr><p class=note>The <code title=dom-document-dir><a href=#dom-document-dir>dir</a></code>
- attribute on the <code><a href=#htmldocument>HTMLDocument</a></code> interface is defined
+ attribute on the <code><a href=#document>Document</a></code> interface is defined
along with the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> content
attribute.</p>
@@ -10884,7 +10867,7 @@ Transport Protocol"&gt;HTTP&lt;/abbr&gt; today.&lt;/p&gt;</pre>
<a href=#limited-to-only-known-values>limited to only known values</a>.</p>
<p>The <dfn id=dom-document-dir title=dom-document-dir><code>dir</code></dfn> IDL
- attribute on <code><a href=#htmldocument>HTMLDocument</a></code> objects must
+ attribute on <code><a href=#document>Document</a></code> objects must
<a href=#reflect>reflect</a> the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> content
attribute of <a href=#the-html-element-0>the <code>html</code> element</a>, if any,
<a href=#limited-to-only-known-values>limited to only known values</a>. If there is no such
@@ -13066,10 +13049,10 @@ plaintext = *( %x0000-2029 / %x202F-10FFFF )
tasks</a> or <a href=#completely-loaded>completely loaded</a>.</p>
<p>When called with three or more arguments, the <code title=dom-document-open><a href=#dom-document-open>open()</a></code> method on the
- <code><a href=#htmldocument>HTMLDocument</a></code> object must call the <code title=dom-open><a href=#dom-open>open()</a></code> method on the <code><a href=#window>Window</a></code>
- object of the <code><a href=#htmldocument>HTMLDocument</a></code> object, with the same
+ <code><a href=#document>Document</a></code> object must call the <code title=dom-open><a href=#dom-open>open()</a></code> method on the <code><a href=#window>Window</a></code>
+ object of the <code><a href=#document>Document</a></code> object, with the same
arguments as the original call to the <code title=dom-document-open><a href=#dom-document-open>open()</a></code> method, and return whatever
- that method returned. If the <code><a href=#htmldocument>HTMLDocument</a></code> object has no
+ that method returned. If the <code><a href=#document>Document</a></code> object has no
<code><a href=#window>Window</a></code> object, then the method must throw an
<code><a href=#invalidaccesserror>InvalidAccessError</a></code> exception.</p>
@@ -54359,7 +54342,7 @@ fur
</dl><div class=impl>
<p>The <dfn id=dom-document-commands title=dom-document-commands><code>commands</code></dfn> attribute
- of the document's <code><a href=#htmldocument>HTMLDocument</a></code> interface must return an
+ of the document's <code><a href=#document>Document</a></code> interface must return an
<code><a href=#htmlcollection>HTMLCollection</a></code> rooted at the <code><a href=#document>Document</a></code>
node, whose filter matches only elements that <a href=#concept-command title=concept-command>define commands</a> and have <a href=#command-facet-id title=command-facet-ID>IDs</a>.</p>
@@ -62595,7 +62578,7 @@ interface <dfn id=window>Window</dfn> : <a href=#eventtarget>EventTarget</a> {
context</a>'s <a href=#active-document>active document</a>.</p>
<p>The <dfn id=dom-document-defaultview title=dom-document-defaultView><code>defaultView</code></dfn> IDL
- attribute of the <code><a href=#htmldocument>HTMLDocument</a></code> interface must return the
+ attribute of the <code><a href=#document>Document</a></code> interface must return the
<code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>'s
<code><a href=#windowproxy>WindowProxy</a></code> object, if there is one, or null
otherwise.</p>
@@ -64365,7 +64348,7 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
</dl><div class=impl>
<p>The <dfn id=dom-document-location title=dom-document-location><code>location</code></dfn> attribute
- of the <code><a href=#htmldocument>HTMLDocument</a></code> interface must return the
+ of the <code><a href=#document>Document</a></code> interface must return the
<code><a href=#location>Location</a></code> object for that <code><a href=#document>Document</a></code> object,
if it is in a <a href=#browsing-context>browsing context</a>, and null otherwise.</p>
@@ -69625,7 +69608,7 @@ interface <dfn id=function>Function</dfn> {
</table><p class=note>The <code title=handler-window-onerror><a href=#handler-window-onerror>onerror</a></code>
handler is also used for <a href=#runtime-script-errors>reporting script errors</a>.</p>
- <hr><!-- this guy is only on HTMLDocument and not on HTMLElement because
+ <hr><!-- this guy is only on Document and not on HTMLElement because
otherwise HTMLScriptElement would have it and that causes
compatibility issues since IE fires readystatechange events on
<script>, not load events, and we can't fire both, and some sites
@@ -72012,13 +71995,13 @@ interface <dfn id=navigatorstorageutils>NavigatorStorageUtils</dfn> {
</dl><div class=impl>
<p>The <dfn id=dom-document-activeelement title=dom-document-activeElement><code>activeElement</code></dfn>
- attribute on <code><a href=#htmldocument>HTMLDocument</a></code> objects must return the
+ attribute on <code><a href=#document>Document</a></code> objects must return the
element in the document that is focused. If no element in the
<code><a href=#document>Document</a></code> is focused, this must return <a href=#the-body-element-0>the body
element</a>.</p>
<p>The <dfn id=dom-document-hasfocus title=dom-document-hasFocus><code>hasFocus()</code></dfn> method
- on <code><a href=#htmldocument>HTMLDocument</a></code> objects must return true if the
+ on <code><a href=#document>Document</a></code> objects must return true if the
<code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a> is focused,
and all its <a href=#ancestor-browsing-context title="ancestor browsing context">ancestor
browsing contexts</a> are also focused, and the <a href=#top-level-browsing-context>top-level
@@ -97466,7 +97449,7 @@ if (s = prompt('What is your name?')) {
spec, albeit as obsolete, and then we say that only elements not
defined in this spec use HTMLUnknownElement. -->
- <hr><pre class=idl>partial interface <a href=#htmldocument>HTMLDocument</a> {
+ <hr><pre class=idl>partial interface <a href=#document>Document</a> {
[TreatNullAs=EmptyString] attribute DOMString <a href=#dom-document-fgcolor title=dom-document-fgColor>fgColor</a>;
[TreatNullAs=EmptyString] attribute DOMString <a href=#dom-document-linkcolor title=dom-document-linkColor>linkColor</a>;
[TreatNullAs=EmptyString] attribute DOMString <a href=#dom-document-vlinkcolor title=dom-document-vlinkColor>vlinkColor</a>;
@@ -102645,8 +102628,8 @@ if (s = prompt('What is your name?')) {
library.onload = function() {
var sound1 = library.getAudio("sound1.wav"); // returns an Audio object
var image1 = library.getImage("image1.png"); // returns an HTMLImageElement
- var doc1 = library.getXMLDocument("doc1.xml"); // returns a Document
- var doc2 = library.getHTMLDocument("doc1.html"); // returns an HTMLDocument
+ var doc1 = library.getXMLDocument("doc1.xml"); // returns a Document (XML Document mode)
+ var doc2 = library.getHTMLDocument("doc1.html"); // returns a Document (HTML Document mode)
}
or:
var library = new ResourceLoader("data.zip");
View
84 source
@@ -931,7 +931,7 @@
<pre>&lt;<span>form</span> <span title="attr-form-name">name</span>="main">
Result: &lt;<span>output</span> <span title="attr-fe-name">name</span>="result">&lt;/output>
&lt;<span>script</span>>
- <span title="HTMLDocument">document</span>.<span title="dom-document-forms">forms</span>.main.<span title="dom-form-elements">elements</span>.result.<span title="dom-output-value">value</span> = 'Hello World';
+ <span title="Document">document</span>.<span title="dom-document-forms">forms</span>.main.<span title="dom-form-elements">elements</span>.result.<span title="dom-output-value">value</span> = 'Hello World';
&lt;/script>
&lt;/form></pre>
@@ -941,7 +941,7 @@
can have its "<code title="attr-hyperlink-href">href</code>"
attribute changed in several ways:</p>
- <pre>var a = <span title="HTMLDocument">document</span>.<span title="dom-document-links">links</span>[0]; // obtain the first link in the document
+ <pre>var a = <span title="Document">document</span>.<span title="dom-document-links">links</span>[0]; // obtain the first link in the document
a.<span title="dom-a-href">href</span> = 'sample.html'; // change the destination URL of the link
a.<span title="dom-uda-protocol">protocol</span> = 'https'; // change just the scheme part of the URL
a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
@@ -9249,27 +9249,10 @@ interface <dfn>Transferable</dfn> { };</pre>
<h4>Documents in the DOM</h4>
- <p>All <code>Document</code> objects (in user agents implementing
- this specification) <span class="impl">must</span> also implement
- the <code>HTMLDocument</code> interface, available using
- binding-specific methods. (This is the case whether or not the
- document in question is an <span title="HTML documents">HTML
- document</span> or indeed whether it contains any <span>HTML
- elements</span> at all.) <code>Document</code> objects <span
- class="impl">must</span> also implement the document-level interface
- of any other namespaces that the UA supports.</p>
-
- <p class="example">For example, if an HTML implementation also
- supports SVG, then the <code>Document</code> object implements both
- <code>HTMLDocument</code> and <code>SVGDocument</code>.</p>
-
- <p class="note">Because the <code>HTMLDocument</code> interface is
- now obtained using binding-specific casting methods instead of
- simply being the primary interface of the document object, it is no
- longer defined as inheriting from <code>Document</code>.</p>
-
<pre class="idl">[OverrideBuiltins]
-interface <dfn>HTMLDocument</dfn> {
+partial interface <span>Document</span> {
+ readonly attribute <code>Document</code> <span title="HTMLDocument">HTMLDocument</span>;
+
// <span>resource metadata management</span>
[PutForwards=<span title="dom-location-href">href</span>] readonly attribute <span>Location</span>? <span title="dom-document-location">location</span>;
readonly attribute DOMString <span title="dom-document-URL">URL</span>;
@@ -9296,7 +9279,7 @@ interface <dfn>HTMLDocument</dfn> {
<!--END w3c-html--><!--CSSREF--> readonly attribute <span>DOMElementMap</span> <span title="dom-document-cssElementMap">cssElementMap</span>;<!--START w3c-html--><!--CSSREF-->
// <span>dynamic markup insertion</span>
- <span>HTMLDocument</span> <span title="dom-document-open">open</span>(optional DOMString type, optional DOMString replace);
+ <span>Document</span> <span title="dom-document-open">open</span>(optional DOMString type, optional DOMString replace);
<span>WindowProxy</span> <span title="dom-document-open">open</span>(DOMString url, DOMString name, DOMString features, optional boolean replace);
void <span title="dom-document-close">close</span>();
void <span title="dom-document-write">write</span>(DOMString... text);
@@ -9374,12 +9357,10 @@ interface <dfn>HTMLDocument</dfn> {
// special <span>event handler IDL attributes</span> that only apply to Document objects
[TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-onreadystatechange">onreadystatechange</span>;
-};
-<span>Document</span> implements <span>HTMLDocument</span>;</pre>
+};</pre>
- <p>Since the <code>HTMLDocument</code> interface holds methods and
- attributes related to a number of disparate features, the members of
- this interface are described in various different sections.</p>
+ <p>The <dfn><code>HTMLDocument</code></dfn> IDL attribute must
+ return the <code>Document</code> object on which it is called.</p>
<h4 id="security-document">Security</h4>
@@ -9725,8 +9706,9 @@ interface <dfn>HTMLDocument</dfn> {
<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 IDL attribute of the same name on the
- <code>SVGDocument</code> interface. Stop the algorithm here. <a
+ 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>
<li>If <span>the <code>title</code> element</span> is null and
@@ -9749,10 +9731,10 @@ interface <dfn>HTMLDocument</dfn> {
</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. <a
+ <p>The <code title="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>
</div>
@@ -10024,7 +10006,7 @@ interface <dfn>HTMLDocument</dfn> {
<hr>
- <p>The <code>HTMLDocument</code> interface <span title="support
+ <p>The <code>Document</code> interface <span title="support
named properties">supports named properties</span>. The
<span>supported property names</span> at any moment consist of the
values of the <code title="attr-name">name</code> content attributes
@@ -10050,7 +10032,7 @@ interface <dfn>HTMLDocument</dfn> {
<p>To <span>determine the value of a named property</span> <var
title="">name</var> when <dfn title="dom-document-namedItem">the
- <code>HTMLDocument</code> object is indexed for property
+ <code>Document</code> object is indexed for property
retrieval</dfn>, the user agent must return the value obtained using
the following steps:</p>
@@ -10137,7 +10119,7 @@ interface <dfn>HTMLDocument</dfn> {
<hr>
<p class="note">The <code title="dom-document-dir">dir</code>
- attribute on the <code>HTMLDocument</code> interface is defined
+ attribute on the <code>Document</code> interface is defined
along with the <code title="attr-dir">dir</code> content
attribute.</p>
@@ -11175,7 +11157,7 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></pre>
<span>limited to only known values</span>.</p>
<p>The <dfn title="dom-document-dir"><code>dir</code></dfn> IDL
- attribute on <code>HTMLDocument</code> objects must
+ attribute on <code>Document</code> objects must
<span>reflect</span> the <code title="attr-dir">dir</code> content
attribute of <span>the <code>html</code> element</span>, if any,
<span>limited to only known values</span>. If there is no such
@@ -13647,12 +13629,12 @@ plaintext = *( %x0000-2029 / %x202F-10FFFF )
<p>When called with three or more arguments, the <code
title="dom-document-open">open()</code> method on the
- <code>HTMLDocument</code> object must call the <code
+ <code>Document</code> object must call the <code
title="dom-open">open()</code> method on the <code>Window</code>
- object of the <code>HTMLDocument</code> object, with the same
+ object of the <code>Document</code> object, with the same
arguments as the original call to the <code
title="dom-document-open">open()</code> method, and return whatever
- that method returned. If the <code>HTMLDocument</code> object has no
+ that method returned. If the <code>Document</code> object has no
<code>Window</code> object, then the method must throw an
<code>InvalidAccessError</code> exception.</p>
@@ -61210,7 +61192,7 @@ fur
<p>The <dfn
title="dom-document-commands"><code>commands</code></dfn> attribute
- of the document's <code>HTMLDocument</code> interface must return an
+ of the document's <code>Document</code> interface must return an
<code>HTMLCollection</code> rooted at the <code>Document</code>
node, whose filter matches only elements that <span
title="concept-command">define commands</span> and have <span
@@ -65795,7 +65777,7 @@ document.body.appendChild(outer);</pre>
<h3>Microdata DOM API</h3>
<!--END html--><!--END dev-html--><!--END complete--><!--END epub--><!--MD-->
- <pre class="idl">partial interface <span>HTMLDocument</span> { <!--WARNING: ALSO DUPLICATED IN HTMLDocument SECTION-->
+ <pre class="idl">partial interface <span>Document</span> { <!--WARNING: ALSO DUPLICATED IN Document SECTION-->
NodeList <span title="dom-document-getItems">getItems</span>(optional DOMString typeNames); // <span>microdata</span>
};
@@ -71055,7 +71037,7 @@ interface <dfn>Window</dfn> : <span>EventTarget</span> {
<p>The <dfn
title="dom-document-defaultView"><code>defaultView</code></dfn> IDL
- attribute of the <code>HTMLDocument</code> interface must return the
+ attribute of the <code>Document</code> interface must return the
<code>Document</code>'s <span>browsing context</span>'s
<code>WindowProxy</code> object, if there is one, or null
otherwise.</p>
@@ -73079,7 +73061,7 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<p>The <dfn
title="dom-document-location"><code>location</code></dfn> attribute
- of the <code>HTMLDocument</code> interface must return the
+ of the <code>Document</code> interface must return the
<code>Location</code> object for that <code>Document</code> object,
if it is in a <span>browsing context</span>, and null otherwise.</p>
@@ -79207,7 +79189,7 @@ interface <dfn>Function</dfn> {
<hr>
- <!-- this guy is only on HTMLDocument and not on HTMLElement because
+ <!-- this guy is only on Document and not on HTMLElement because
otherwise HTMLScriptElement would have it and that causes
compatibility issues since IE fires readystatechange events on
<script>, not load events, and we can't fire both, and some sites
@@ -81969,14 +81951,14 @@ interface <dfn>NavigatorStorageUtils</dfn> {
<p>The <dfn
title="dom-document-activeElement"><code>activeElement</code></dfn>
- attribute on <code>HTMLDocument</code> objects must return the
+ attribute on <code>Document</code> objects must return the
element in the document that is focused. If no element in the
<code>Document</code> is focused, this must return <span>the body
element</span>.</p>
<p>The <dfn
title="dom-document-hasFocus"><code>hasFocus()</code></dfn> method
- on <code>HTMLDocument</code> objects must return true if the
+ on <code>Document</code> objects must return true if the
<code>Document</code>'s <span>browsing context</span> is focused,
and all its <span title="ancestor browsing context">ancestor
browsing contexts</span> are also focused, and the <span>top-level
@@ -110619,7 +110601,7 @@ if (s = prompt('What is your name?')) {
<hr>
- <pre class="idl">partial interface <span>HTMLDocument</span> {
+ <pre class="idl">partial interface <span>Document</span> {
[TreatNullAs=EmptyString] attribute DOMString <span title="dom-document-fgColor">fgColor</span>;
[TreatNullAs=EmptyString] attribute DOMString <span title="dom-document-linkColor">linkColor</span>;
[TreatNullAs=EmptyString] attribute DOMString <span title="dom-document-vlinkColor">vlinkColor</span>;
@@ -116970,8 +116952,8 @@ if (s = prompt('What is your name?')) {
library.onload = function() {
var sound1 = library.getAudio("sound1.wav"); // returns an Audio object
var image1 = library.getImage("image1.png"); // returns an HTMLImageElement
- var doc1 = library.getXMLDocument("doc1.xml"); // returns a Document
- var doc2 = library.getHTMLDocument("doc1.html"); // returns an HTMLDocument
+ var doc1 = library.getXMLDocument("doc1.xml"); // returns a Document (XML Document mode)
+ var doc2 = library.getHTMLDocument("doc1.html"); // returns a Document (HTML Document mode)
}
or:
var library = new ResourceLoader("data.zip");

0 comments on commit 83f13ee

Please sign in to comment.
Something went wrong with that request. Please try again.