[html5] r2064 - [] (0) Tighten up document.open()'s type argument processing.

whatwg at whatwg.org whatwg at whatwg.org
Tue Aug 12 16:59:12 PDT 2008


Author: ianh
Date: 2008-08-12 16:59:10 -0700 (Tue, 12 Aug 2008)
New Revision: 2064

Modified:
   index
   source
Log:
[] (0) Tighten up document.open()'s type argument processing.

/home/ianh/svn/webapps/hooks/commit-email.pl: `/usr/bin/svnlook diff /home/ianh/svn/webapps -r 2064' failed with this output:
Modified: index
===================================================================
--- index	2008-08-12 22:46:29 UTC (rev 2063)
+++ index	2008-08-12 23:59:10 UTC (rev 2064)
@@ -8889,18 +8889,26 @@
      before emitting an end-of-file token).
 
    <li>Mark the document as being an <a href="#html-" title="HTML
-    documents">HTML document</a> (it might already be so-marked).</li>
-   <!-- text/plain handling -->
+    documents">HTML document</a> (it might already be so-marked).
 
-   <li>
-    <p>If <var title="">type</var> does not have the value
-     "<code>text/html</code>"<!-- XXX matched how?
-   -->, then act as if the
-     tokeniser had emitted a start tag token with the tag name "pre", then
-     set the <a href="#html-0">HTML parser</a>'s <a
+   <li> <!-- text/plain handling -->
+    <p>If <var title="">type</var> is an <a href="#ascii">ASCII
+     case-insensitive</a> match for the stirng "<code>text/plain</code>",
+     then act as if the tokeniser had emitted a start tag token with the tag
+     name "pre", then set the <a href="#html-0">HTML parser</a>'s <a
      href="#tokenization0">tokenization</a> stage's <a
-     href="#content4">content model flag</a> to <em>PLAINTEXT</em>.
+     href="#content4">content model flag</a> to <em>PLAINTEXT</em>.</p>
 
+    <p class=note>All other values are treated as <code>text/html</code>.</p>
+    <!--
+ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20%0D%0A%20%20var%20d%20%3D%20document.getElementsByTagName('iframe')%5B0%5D.contentDocument%3B%0D%0A%20%20d.open('image%2Fsvg%2Bxml')%3B%0D%0A%20%20d.write(%22%3Cinput%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%20value%3D'(x)html'%2F%3E%22)%3B%0D%0A%20%20d.close()%3B%0D%0A%7D%3B%3C%2Fscript%3E
+ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20%0D%0A%20%20var%20d%20%3D%20document.getElementsByTagName('iframe')%5B0%5D.contentDocument%3B%0D%0A%20%20d.open('image%2Fgif')%3B%0D%0A%20%20var%20a%20%3D%20%5B%200x47%2C%200x49%2C%200x46%2C%200x38%2C%200x39%2C%200x61%2C%200x01%2C%200x00%2C%200x01%2C%200x00%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200x80%2C%200xff%2C%200x00%2C%200xc0%2C%200xc0%2C%200xc0%2C%200x00%2C%200x00%2C%200x00%2C%200x21%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200xf9%2C%200x04%2C%200x01%2C%200x00%2C%200x00%2C%200x00%2C%200x00%2C%200x2c%2C%200x00%2C%200x00%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200x00%2C%200x00%2C%200x01%2C%200x00%2C%200x01%2C%200x00%2C%200x00%2C%200x02%2C%200x02%2C%200x44%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200x01%2C%200x00%2C%200x3b%20%5D%3B%0D%0A%20%20var%20s%20%3D%20%22%22%3B%0D%0A%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20a.length%3B%20i%20%2B%3D%201)%0D%0A%20%20%20%20s%20%2B%3D%20String.fromCharCode(a%5Bi%5D)%3B%0D%0A%20%20d.write(s)%3B%0D%0A%20%20d.close()%3B%0D%0A%7D%3B%3C%2Fscript%3E
+ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20{%20%0A%20%20var%20d%20%3D%20document.getElementsByTagName(%27iframe%27)[0].contentDocument%3B%0A%20%20d.open(%27Text%2Fplain%27)%3B%0A%20%20d.write(%27%3Cb%3Etest%27)%3B%0A%20%20d.close()%3B%0A}%3B%3C%2Fscript%3E
+ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20{%20%0A%20%20var%20d%20%3D%20document.getElementsByTagName(%27iframe%27)[0].contentDocument%3B%0A%20%20d.open(%27%20text%2Fplain%27)%3B%0A%20%20d.write(%27%3Cb%3Etest%27)%3B%0A%20%20d.close()%3B%0A}%3B%3C%2Fscript%3E
+ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%3E%3C%2Fiframe%3E%3Cscript%3Eonload%20%3D%20function%20()%20{%20%0A%20%20var%20d%20%3D%20document.getElementsByTagName(%27iframe%27)[0].contentDocument%3B%0A%20%20d.open(%27text%2Fplain%3B%27)%3B%0A%20%20d.write(%27%3Cb%3Etest%27)%3B%0A%20%20d.close()%3B%0A}%3B%3C%2Fscript%3E
+    -->
+    
+
    <li>
     <p>If <var title="">replace</var> is false, then:
 
@@ -8930,12 +8938,6 @@
     <p>Return the <code>Document</code> on which the method was invoked.
   </ol>
 
-  <p class=big-issue>We shouldn't hard-code <code>text/plain</code> there. We
-   should do it some other way, e.g. hand off to the section on
-   content-sniffing and handling of incoming data streams, the part that
-   defines how this all works when stuff comes over the network.</p>
-  <!-- XXX Should we support XML/XHTML as a type to that method? -->
-
   <p>When called with three or more arguments, the <code
    title=dom-document-open><a href="#open">open()</a></code> method on the
    <code><a href="#htmldocument">HTMLDocument</a></code> object must call the

Modified: source
===================================================================



More information about the Commit-Watchers mailing list