[html5] r5199 - [giow] (2) Reluctantly define document.load().

whatwg at whatwg.org whatwg at whatwg.org
Mon Jul 26 22:37:12 PDT 2010


Author: ianh
Date: 2010-07-26 22:37:11 -0700 (Mon, 26 Jul 2010)
New Revision: 5199

Modified:
   complete.html
   index
Log:
[giow] (2) Reluctantly define document.load().

Modified: complete.html
===================================================================
--- complete.html	2010-07-27 05:36:07 UTC (rev 5198)
+++ complete.html	2010-07-27 05:37:11 UTC (rev 5199)
@@ -374,7 +374,8 @@
      <li><a href=#security-document><span class=secno>3.1.2 </span>Security</a></li>
      <li><a href=#resource-metadata-management><span class=secno>3.1.3 </span>Resource metadata management</a></li>
      <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></li>
-     <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></ol></li>
+     <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></li>
+     <li><a href=#loading-xml-documents><span class=secno>3.1.6 </span>Loading XML documents</a></ol></li>
    <li><a href=#elements><span class=secno>3.2 </span>Elements</a>
     <ol>
      <li><a href=#semantics-0><span class=secno>3.2.1 </span>Semantics</a></li>
@@ -8715,7 +8716,107 @@
   </ol></div>
 
 
+  <div class=impl> <!-- very deprecated API; use XHR instead -->
 
+  <h4 id=loading-xml-documents><span class=secno>3.1.6 </span>Loading XML documents</h4>
+
+  <p>A <code><a href=#document>Document</a></code> object that is an <a href=#xml-documents title="XML
+  documents">XML document</a> must also implement the
+  <code><a href=#xmldocumentloader>XMLDocumentLoader</a></code> interface:</p>
+
+  <pre class=idl>[Supplemental, NoInterfaceObject]
+interface <dfn id=xmldocumentloader>XMLDocumentLoader</dfn> {
+           attribute boolean <a href=#dom-xmldocumentloader-async title=dom-XMLDocumentLoader-async>async</a>;
+  boolean <a href=#dom-xmldocumentloader-load title=dom-XMLDocumentLoader-load>load</a>(in DOMString url);
+};</pre>
+
+  <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/576 -->
+  <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/577 -->
+  <!-- http://www.hixie.ch/tests/adhoc/dom/level0/document/load/001.html -->
+
+  <p>The <dfn id=dom-xmldocumentloader-async title=dom-XMLDocumentLoader-async><code>async</code></dfn>
+  attribute must initially be true. On getting, it must return its
+  current value. On setting, its current value must be changed to the
+  new value.</p>
+
+  <p>The <dfn id=dom-xmldocumentloader-load title=dom-XMLDocumentLoader-load><code>load(<var title="">url</var>)</code></dfn> method must run the following
+  steps:</p>
+
+  <ol><li><p>Let <var title="">document</var> be the <code><a href=#document>Document</a></code>
+   object on which the method was invoked.</p>~</li>
+
+   <li><p>If the <span>origin of <var title="">url</var> is not
+   the same as the <a href=#origin>origin</a> of <var title="">document</var>, throw a <code><a href=#security_err>SECURITY_ERR</a></code>
+   exception.</span></li>
+
+   <li><p>Remove all child nodes of <var title="">document</var>,
+   without firing any mutation events.</li> <!-- as of 2010-07-26,
+   only Opera fired mutation events here. -->
+
+   <li><p>Set the <a href=#current-document-readiness>current document readiness</a> of <var title="">document</var> to "loading".</li>
+
+   <li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
+   set to true, then run the remainder of these steps asynchronously,
+   and return true from the method. Otherwise, continue running these
+   steps without yet returning.</li>
+
+   <li><p>Let <var title="">result</var> be an <code><a href=#document>Document</a></code>
+   object.</li>
+
+   <li><p>Let <var title="">success</var> be false.</li>
+
+   <li><p><a href=#fetch>Fetch</a> <var title="">url</var> from the
+   <a href=#origin>origin</a> of <var title="">document</var>, with the <var title="">synchronous flag</var> set and the <var title="">force
+   same-origin flag</var> set.</li>
+
+   <li>
+
+    <p>If the fetch attempt was successful, and the resource's <a href=#content-type title=Content-Type>Content-Type metadata</a> is an <a href=#xml-mime-type>XML
+    MIME type</a>, then run these substeps:</p>
+
+    <ol><li><p>Create a new <a href=#xml-parser>XML parser</a> associated with the
+     <var title="">result</var> document.</li>
+
+     <li><p>Pass this parser the fetched document.</li> <!-- no
+     worries about scripts running; there's no browsing context for
+     the document so scripts are automatically disabled -->
+
+     <li><p>If there is an XML well-formedness or XML namespace
+     well-formedness error, then remove all child nodes from <var title="">result</var>. Otherwise let <var title="">success</var>
+     be true.</li>
+
+    </ol></li>
+
+   <li>
+
+    <p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
+    set to true, then <a href=#queue-a-task>queue a task</a> to run the following
+    steps. Otherwise, run them synchronously.</p>
+
+    <ol><li><p>Set the <a href=#current-document-readiness>current document readiness</a> of <var title="">document</var> to "complete".</li>
+
+     <li><p>Replace all the children of <var title="">document</var>
+     by the children of <var title="">result</var> (even if it has no
+     children), firing mutation events as if a
+     <code><a href=#documentfragment>DocumentFragment</a></code> containing the new children had
+     been inserted.</li> <!-- as of 2010-07-26, both Firefox and
+     Opera fired mutation events here. -->
+
+     <!-- If the document doesn't have no nodes here, at time of
+     writing, Opera would leave the new nodes and drop the parsed
+     ones, while Firefox would basically abort instead, failing to
+     fire the 'load' event -->
+
+     <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-load>load</code> at <var title="">document</var>.</li>
+
+    </ol></li>
+
+   <li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
+   set to false, return <var title="">success</var>.</li>
+
+  </ol></div>
+
+
   <h3 id=elements><span class=secno>3.2 </span>Elements</h3>
 
   <h4 id=semantics-0><span class=secno>3.2.1 </span>Semantics</h4>
@@ -63716,7 +63817,7 @@
   and <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval()</a></code>
   methods allow authors to schedule timer-based callbacks.</p>
 
-<pre class=idl>[Supplemental, NoInterfaceObject]
+  <pre class=idl>[Supplemental, NoInterfaceObject]
 interface <dfn id=windowtimers>WindowTimers</dfn> {
   long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in any handler, in optional any timeout, in any... args);
   void <a href=#dom-windowtimers-cleartimeout title=dom-windowtimers-clearTimeout>clearTimeout</a>(in long handle);

Modified: index
===================================================================
--- index	2010-07-27 05:36:07 UTC (rev 5198)
+++ index	2010-07-27 05:37:11 UTC (rev 5199)
@@ -381,7 +381,8 @@
      <li><a href=#security-document><span class=secno>3.1.2 </span>Security</a></li>
      <li><a href=#resource-metadata-management><span class=secno>3.1.3 </span>Resource metadata management</a></li>
      <li><a href=#dom-tree-accessors><span class=secno>3.1.4 </span>DOM tree accessors</a></li>
-     <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></ol></li>
+     <li><a href=#creating-documents><span class=secno>3.1.5 </span>Creating documents</a></li>
+     <li><a href=#loading-xml-documents><span class=secno>3.1.6 </span>Loading XML documents</a></ol></li>
    <li><a href=#elements><span class=secno>3.2 </span>Elements</a>
     <ol>
      <li><a href=#semantics-0><span class=secno>3.2.1 </span>Semantics</a></li>
@@ -8639,7 +8640,107 @@
   </ol></div>
 
 
+  <div class=impl> <!-- very deprecated API; use XHR instead -->
 
+  <h4 id=loading-xml-documents><span class=secno>3.1.6 </span>Loading XML documents</h4>
+
+  <p>A <code><a href=#document>Document</a></code> object that is an <a href=#xml-documents title="XML
+  documents">XML document</a> must also implement the
+  <code><a href=#xmldocumentloader>XMLDocumentLoader</a></code> interface:</p>
+
+  <pre class=idl>[Supplemental, NoInterfaceObject]
+interface <dfn id=xmldocumentloader>XMLDocumentLoader</dfn> {
+           attribute boolean <a href=#dom-xmldocumentloader-async title=dom-XMLDocumentLoader-async>async</a>;
+  boolean <a href=#dom-xmldocumentloader-load title=dom-XMLDocumentLoader-load>load</a>(in DOMString url);
+};</pre>
+
+  <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/576 -->
+  <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/577 -->
+  <!-- http://www.hixie.ch/tests/adhoc/dom/level0/document/load/001.html -->
+
+  <p>The <dfn id=dom-xmldocumentloader-async title=dom-XMLDocumentLoader-async><code>async</code></dfn>
+  attribute must initially be true. On getting, it must return its
+  current value. On setting, its current value must be changed to the
+  new value.</p>
+
+  <p>The <dfn id=dom-xmldocumentloader-load title=dom-XMLDocumentLoader-load><code>load(<var title="">url</var>)</code></dfn> method must run the following
+  steps:</p>
+
+  <ol><li><p>Let <var title="">document</var> be the <code><a href=#document>Document</a></code>
+   object on which the method was invoked.</p>~</li>
+
+   <li><p>If the <span>origin of <var title="">url</var> is not
+   the same as the <a href=#origin>origin</a> of <var title="">document</var>, throw a <code><a href=#security_err>SECURITY_ERR</a></code>
+   exception.</span></li>
+
+   <li><p>Remove all child nodes of <var title="">document</var>,
+   without firing any mutation events.</li> <!-- as of 2010-07-26,
+   only Opera fired mutation events here. -->
+
+   <li><p>Set the <a href=#current-document-readiness>current document readiness</a> of <var title="">document</var> to "loading".</li>
+
+   <li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
+   set to true, then run the remainder of these steps asynchronously,
+   and return true from the method. Otherwise, continue running these
+   steps without yet returning.</li>
+
+   <li><p>Let <var title="">result</var> be an <code><a href=#document>Document</a></code>
+   object.</li>
+
+   <li><p>Let <var title="">success</var> be false.</li>
+
+   <li><p><a href=#fetch>Fetch</a> <var title="">url</var> from the
+   <a href=#origin>origin</a> of <var title="">document</var>, with the <var title="">synchronous flag</var> set and the <var title="">force
+   same-origin flag</var> set.</li>
+
+   <li>
+
+    <p>If the fetch attempt was successful, and the resource's <a href=#content-type title=Content-Type>Content-Type metadata</a> is an <a href=#xml-mime-type>XML
+    MIME type</a>, then run these substeps:</p>
+
+    <ol><li><p>Create a new <a href=#xml-parser>XML parser</a> associated with the
+     <var title="">result</var> document.</li>
+
+     <li><p>Pass this parser the fetched document.</li> <!-- no
+     worries about scripts running; there's no browsing context for
+     the document so scripts are automatically disabled -->
+
+     <li><p>If there is an XML well-formedness or XML namespace
+     well-formedness error, then remove all child nodes from <var title="">result</var>. Otherwise let <var title="">success</var>
+     be true.</li>
+
+    </ol></li>
+
+   <li>
+
+    <p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
+    set to true, then <a href=#queue-a-task>queue a task</a> to run the following
+    steps. Otherwise, run them synchronously.</p>
+
+    <ol><li><p>Set the <a href=#current-document-readiness>current document readiness</a> of <var title="">document</var> to "complete".</li>
+
+     <li><p>Replace all the children of <var title="">document</var>
+     by the children of <var title="">result</var> (even if it has no
+     children), firing mutation events as if a
+     <code><a href=#documentfragment>DocumentFragment</a></code> containing the new children had
+     been inserted.</li> <!-- as of 2010-07-26, both Firefox and
+     Opera fired mutation events here. -->
+
+     <!-- If the document doesn't have no nodes here, at time of
+     writing, Opera would leave the new nodes and drop the parsed
+     ones, while Firefox would basically abort instead, failing to
+     fire the 'load' event -->
+
+     <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-load>load</code> at <var title="">document</var>.</li>
+
+    </ol></li>
+
+   <li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
+   set to false, return <var title="">success</var>.</li>
+
+  </ol></div>
+
+
   <h3 id=elements><span class=secno>3.2 </span>Elements</h3>
 
   <h4 id=semantics-0><span class=secno>3.2.1 </span>Semantics</h4>
@@ -63663,7 +63764,7 @@
   and <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval()</a></code>
   methods allow authors to schedule timer-based callbacks.</p>
 
-<pre class=idl>[Supplemental, NoInterfaceObject]
+  <pre class=idl>[Supplemental, NoInterfaceObject]
 interface <dfn id=windowtimers>WindowTimers</dfn> {
   long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in any handler, in optional any timeout, in any... args);
   void <a href=#dom-windowtimers-cleartimeout title=dom-windowtimers-clearTimeout>clearTimeout</a>(in long handle);




More information about the Commit-Watchers mailing list