[html5] r3735 - [gow] (2) Make document.open() throw INVALID_STATE_ERR when called on an xml doc [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Sep 3 02:41:18 PDT 2009


Author: ianh
Date: 2009-09-03 02:41:16 -0700 (Thu, 03 Sep 2009)
New Revision: 3735

Modified:
   index
   source
Log:
[gow] (2) Make document.open() throw INVALID_STATE_ERR when called on an xml doc instead of turning it into an HTML doc.

Modified: index
===================================================================
--- index	2009-09-02 23:30:47 UTC (rev 3734)
+++ index	2009-09-03 09:41:16 UTC (rev 3735)
@@ -71,7 +71,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML5</h1>
-   <h2 class="no-num no-toc" id=draft-standard-—-2-september-2009>Draft Standard — 2 September 2009</h2>
+   <h2 class="no-num no-toc" id=draft-standard-—-3-september-2009>Draft Standard — 3 September 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -6613,10 +6613,9 @@
   certain APIs, as well as a few CSS rendering rules. <a href=#refsCSS>[CSS]</a></p>
 
   <p class=note>A <code>Document</code> object created by the <code title="">createDocument()</code> API on the
-  <code>DOMImplementation</code> object is initially an <a href=#xml-documents title="XML documents">XML document</a>, but can be made into an
-  <a href=#html-documents title="HTML documents">HTML document</a> by calling <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> on it. A
-  <code>Document</code> object created by the <a href=#html-parser>HTML parser</a>
-  for a <code><a href=#text/html>text/html</a></code> resource will be flagged as an <a href=#html-documents title="HTML documents">HTML document</a> also.</p>
+  <code>DOMImplementation</code> object is flagged as an <a href=#xml-documents title="XML documents">XML document</a>. A <code>Document</code>
+  object created by the <a href=#html-parser>HTML parser</a> for a
+  <code><a href=#text/html>text/html</a></code> resource will be flagged as an <a href=#html-documents title="HTML documents">HTML document</a>.</p>
 
 
 
@@ -9490,6 +9489,10 @@
     <p>The method has no effect if the <code>Document</code> is still
     being parsed.</p>
 
+    <p>Throws an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception if the
+    <code>Document</code> is an <a href=#xml-documents title="XML documents">XML
+    document</a>.</p>
+
    </dd>
 
    <dt><var title="">window</var> = <var title="">document</var> . <code title=dom-document-open><a href=#dom-document-open>open</a></code>( <var title="">url</var>, <var title="">name</var>, <var title="">features</var> [, <var title="">replace</var> ] )</dt>
@@ -9506,7 +9509,11 @@
   <p>When called with two or fewer arguments, the method must act as
   follows:</p>
 
-  <ol><li><p>Let <var title="">type</var> be the value of the first
+  <ol><li>If the <code>Document</code> object is not flagged as an <a href=#html-documents title="HTML documents">HTML document</a>, throw an
+   <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception and abort these
+   steps.</li>
+
+   <li><p>Let <var title="">type</var> be the value of the first
    argument, if there is one, or "<code><a href=#text/html>text/html</a></code>"
    otherwise.</li>
 
@@ -9583,9 +9590,6 @@
    an end-of-file token). The encoding <a href=#concept-encoding-confidence title=concept-encoding-confidence>confidence</a> is
    <i>irrelevant</i>.</li>
 
-   <li>Mark the document as being an <a href=#html-documents title="HTML documents">HTML
-   document</a> (it might already be so-marked).</li>
-
    <li>
 
     <!-- text/plain handling -->

Modified: source
===================================================================
--- source	2009-09-02 23:30:47 UTC (rev 3734)
+++ source	2009-09-03 09:41:16 UTC (rev 3735)
@@ -6583,13 +6583,11 @@
 
   <p class="note">A <code>Document</code> object created by the <code
   title="">createDocument()</code> API on the
-  <code>DOMImplementation</code> object is initially an <span
-  title="XML documents">XML document</span>, but can be made into an
-  <span title="HTML documents">HTML document</span> by calling <code
-  title="dom-document-open">document.open()</code> on it. A
-  <code>Document</code> object created by the <span>HTML parser</span>
-  for a <code>text/html</code> resource will be flagged as an <span
-  title="HTML documents">HTML document</span> also.</p>
+  <code>DOMImplementation</code> object is flagged as an <span
+  title="XML documents">XML document</span>. A <code>Document</code>
+  object created by the <span>HTML parser</span> for a
+  <code>text/html</code> resource will be flagged as an <span
+  title="HTML documents">HTML document</span>.</p>
 
 
 
@@ -9873,6 +9871,10 @@
     <p>The method has no effect if the <code>Document</code> is still
     being parsed.</p>
 
+    <p>Throws an <code>INVALID_STATE_ERR</code> exception if the
+    <code>Document</code> is an <span title="XML documents">XML
+    document</span>.</p>
+
    </dd>
 
    <dt><var title="">window</var> = <var title="">document</var> . <code title="dom-document-open">open</code>( <var title="">url</var>, <var title="">name</var>, <var title="">features</var> [, <var title="">replace</var> ] )</dt>
@@ -9893,6 +9895,11 @@
 
   <ol>
 
+   <li>If the <code>Document</code> object is not flagged as an <span
+   title="HTML documents">HTML document</span>, throw an
+   <code>INVALID_STATE_ERR</code> exception and abort these
+   steps.</li>
+
    <li><p>Let <var title="">type</var> be the value of the first
    argument, if there is one, or "<code>text/html</code>"
    otherwise.</p></li>
@@ -9975,9 +9982,6 @@
    title="concept-encoding-confidence">confidence</span> is
    <i>irrelevant</i>.</p></li>
 
-   <li>Mark the document as being an <span title="HTML documents">HTML
-   document</span> (it might already be so-marked).</li>
-
    <li>
 
     <!-- text/plain handling -->




More information about the Commit-Watchers mailing list