Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (1) Remove document.async and restrict document.load to create…
…Document() documents.

git-svn-id: http://svn.whatwg.org/webapps@5285 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 12, 2010
1 parent 6fa6a42 commit e236f46
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 75 deletions.
63 changes: 34 additions & 29 deletions complete.html
Expand Up @@ -8737,53 +8737,56 @@ <h4 id=creating-documents><span class=secno>3.1.5 </span>Creating documents</h4>
<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
documents">XML document</a> that was created by the <code title=dom-DOMImplementation-createDocument><a href=#dom-domimplementation-createdocument>DOMImplementation.createDocument()</a></code>
factory method 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);
<!--SYNCLOAD attribute boolean <span title="dom-XMLDocumentLoader-async">async</span>;
--> 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>
<!--SYNCLOAD
<p>The <dfn
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>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
<ol><!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to false and the <var title="">document</var> is
<a href=#load-blocked>load-blocked</a>, return false and abort these
steps.</li>

<li><p>Let <var title="">document</var> be the <code><a href=#document>Document</a></code>
<span>load-blocked</span>, return false and abort these
steps.</p></li>
--><li><p>Let <var title="">document</var> be the <code><a href=#document>Document</a></code>
object on which the method was invoked.</li>

<li><p>If the <a href=#origin>origin</a> 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.</li>

<li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to false, let <var title="">document</var> be
<dfn id=load-blocked>load-blocked</dfn>.</li>

<dfn>load-blocked</dfn>.</p></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><!--SYNCLOAD If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then run--> Run the remainder of these steps asynchronously,
and return true from the method.<!--SYNCLOAD 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>
Expand Down Expand Up @@ -8814,9 +8817,9 @@ <h4 id=loading-xml-documents><span class=secno>3.1.6 </span>Loading XML document

<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>
<p><!--SYNCLOAD If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then <span>queue--> <a href=#queue-a-task>Queue a task</a> to run the following
steps. <!--SYNCLOAD 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>

Expand All @@ -8835,14 +8838,16 @@ <h4 id=loading-xml-documents><span class=secno>3.1.6 </span>Loading XML document
<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>
was set to false when this algorithm started, let <var title="">document</var> be no longer
<a href=#load-blocked>load-blocked</a>.</li>

<li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code>
was set to false when this algorithm started, return <var title="">success</var>.</li>

<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code>
was set to false when this algorithm started, let <var
title="">document</var> be no longer
<span>load-blocked</span>.</p></li>

<li><p>If <code title="dom-XMLDocumentLoader-async">async</code>
was set to false when this algorithm started, return <var
title="">success</var>.</p></li>
-->
</ol></div>


Expand Down
63 changes: 34 additions & 29 deletions index
Expand Up @@ -8661,53 +8661,56 @@ interface <dfn id=domhtmlimplementation>DOMHTMLImplementation</dfn> {
<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
documents">XML document</a> that was created by the <code title=dom-DOMImplementation-createDocument><a href=#dom-domimplementation-createdocument>DOMImplementation.createDocument()</a></code>
factory method 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);
<!--SYNCLOAD attribute boolean <span title="dom-XMLDocumentLoader-async">async</span>;
--> 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>
<!--SYNCLOAD
<p>The <dfn
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>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
<ol><!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to false and the <var title="">document</var> is
<a href=#load-blocked>load-blocked</a>, return false and abort these
steps.</li>

<li><p>Let <var title="">document</var> be the <code><a href=#document>Document</a></code>
<span>load-blocked</span>, return false and abort these
steps.</p></li>
--><li><p>Let <var title="">document</var> be the <code><a href=#document>Document</a></code>
object on which the method was invoked.</li>

<li><p>If the <a href=#origin>origin</a> 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.</li>

<li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code> is
<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to false, let <var title="">document</var> be
<dfn id=load-blocked>load-blocked</dfn>.</li>

<dfn>load-blocked</dfn>.</p></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><!--SYNCLOAD If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then run--> Run the remainder of these steps asynchronously,
and return true from the method.<!--SYNCLOAD 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>
Expand Down Expand Up @@ -8738,9 +8741,9 @@ interface <dfn id=xmldocumentloader>XMLDocumentLoader</dfn> {

<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>
<p><!--SYNCLOAD If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then <span>queue--> <a href=#queue-a-task>Queue a task</a> to run the following
steps. <!--SYNCLOAD 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>

Expand All @@ -8759,14 +8762,16 @@ interface <dfn id=xmldocumentloader>XMLDocumentLoader</dfn> {
<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>
was set to false when this algorithm started, let <var title="">document</var> be no longer
<a href=#load-blocked>load-blocked</a>.</li>

<li><p>If <code title=dom-XMLDocumentLoader-async><a href=#dom-xmldocumentloader-async>async</a></code>
was set to false when this algorithm started, return <var title="">success</var>.</li>

<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code>
was set to false when this algorithm started, let <var
title="">document</var> be no longer
<span>load-blocked</span>.</p></li>

<li><p>If <code title="dom-XMLDocumentLoader-async">async</code>
was set to false when this algorithm started, return <var
title="">success</var>.</p></li>
-->
</ol></div>


Expand Down
37 changes: 20 additions & 17 deletions source
Expand Up @@ -8727,59 +8727,62 @@ interface <dfn>DOMHTMLImplementation</dfn> {
<h4>Loading XML documents</h4>

<p>A <code>Document</code> object that is an <span title="XML
documents">XML document</span> must also implement the
documents">XML document</span> that was created by the <code
title="dom-DOMImplementation-createDocument">DOMImplementation.createDocument()</code>
factory method must also implement the
<code>XMLDocumentLoader</code> interface:</p>

<pre class="idl">[Supplemental, NoInterfaceObject]
interface <dfn>XMLDocumentLoader</dfn> {
attribute boolean <span title="dom-XMLDocumentLoader-async">async</span>;
boolean <span title="dom-XMLDocumentLoader-load">load</span>(in DOMString url);
<!--SYNCLOAD attribute boolean <span title="dom-XMLDocumentLoader-async">async</span>;
--> boolean <span title="dom-XMLDocumentLoader-load">load</span>(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 -->

<!--SYNCLOAD
<p>The <dfn
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 title="dom-XMLDocumentLoader-load"><code>load(<var
title="">url</var>)</code></dfn> method must run the following
steps:</p>

<ol>

<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to false and the <var title="">document</var> is
<span>load-blocked</span>, return false and abort these
steps.</p></li>

-->
<li><p>Let <var title="">document</var> be the <code>Document</code>
object on which the method was invoked.</p></li>

<li><p>If the <span>origin</span> of <var title="">url</var> is not
the same as the <span>origin</span> of <var
title="">document</var>, throw a <code>SECURITY_ERR</code>
exception.</p></li>

<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to false, let <var title="">document</var> be
<dfn>load-blocked</dfn>.</p></li>

-->
<li><p>Remove all child nodes of <var title="">document</var>,
without firing any mutation events.</p></li> <!-- as of 2010-07-26,
only Opera fired mutation events here. -->

<li><p>Set the <span>current document readiness</span> of <var
title="">document</var> to "loading".</p></li>

<li><p>If <code title="dom-XMLDocumentLoader-async">async</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.</p></li>
<li><p><!--SYNCLOAD If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then run--> Run the remainder of these steps asynchronously,
and return true from the method.<!--SYNCLOAD Otherwise, continue running these
steps without yet returning.--></p></li>

<li><p>Let <var title="">result</var> be an <code>Document</code>
object.</p></li>
Expand Down Expand Up @@ -8817,9 +8820,9 @@ interface <dfn>XMLDocumentLoader</dfn> {

<li>

<p>If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then <span>queue a task</span> to run the following
steps. Otherwise, run them synchronously.</p>
<p><!--SYNCLOAD If <code title="dom-XMLDocumentLoader-async">async</code> is
set to true, then <span>queue--> <span>Queue a task</span> to run the following
steps. <!--SYNCLOAD Otherwise, run them synchronously.--></p>

<ol>

Expand All @@ -8845,7 +8848,7 @@ interface <dfn>XMLDocumentLoader</dfn> {
</ol>

</li>

<!--SYNCLOAD
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code>
was set to false when this algorithm started, let <var
title="">document</var> be no longer
Expand All @@ -8854,7 +8857,7 @@ interface <dfn>XMLDocumentLoader</dfn> {
<li><p>If <code title="dom-XMLDocumentLoader-async">async</code>
was set to false when this algorithm started, return <var
title="">success</var>.</p></li>

-->
</ol>

</div>
Expand Down

0 comments on commit e236f46

Please sign in to comment.