restrict text/html to responseType being "document"
authorAnne van Kesteren <annevk@opera.com>
Thu, 24 Nov 2011 16:05:05 +0100
changeset 6 236face6f073
parent 5 02b3d18a4907
child 7 0a88771ad46e
restrict text/html to responseType being "document"
Overview.html
Overview.src.html
--- a/Overview.html	Thu Nov 24 15:54:16 2011 +0100
+++ b/Overview.html	Thu Nov 24 16:05:05 2011 +0100
@@ -2334,7 +2334,7 @@
 
    <li><p>Return the result of decoding the
    <a href="#response-entity-body">response entity body</a> using <var>charset</var>. Replace bytes
-   or sequences of bytes that are not valid accordng to the
+   or sequences of bytes that are not valid according to the
    <var>charset</var> with a single
    U+FFFD REPLACEMENT CHARACTER character. Remove one leading
    U+FEFF BYTE ORDER MARK character, if present.
@@ -2345,10 +2345,12 @@
 
   <hr>
 
-  <p>The <dfn id="document-response-entity-body">document response entity
-  body</dfn> is either a <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code> representing the
+  <p>The
+  <dfn id="document-response-entity-body">document response entity body</dfn>
+  is either a <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code> representing the
   <a href="#response-entity-body">response entity body</a> or null. If it is a
-  <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code> its <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> is the
+  <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code>, its
+  <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> is the
   <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a>. If the
   <a href="#document-response-entity-body">document response entity body</a> has no value assigned to it let
   it be the return value of the following algorithm:</p>
@@ -2360,9 +2362,17 @@
    <li><p>If <a href="#final-mime-type">final MIME type</a> is not null,
    <code>text/html</code>, <code>text/xml</code>,
    <code>application/xml</code>, or does not end in
-   <code title="">+xml</code>, return null and terminate these
-   steps.</li>
-
+   <code title="">+xml</code>, return null and terminate these steps.
+
+   <li>
+    <p>If <code title="dom-XMLHttpRequest-responseType"><a href="#dom-xmlhttprequest-responsetype">responseType</a></code> is
+    the empty string and <a href="#final-mime-type">final MIME type</a> is
+    <code>text/html</code>, return null and terminate these steps.
+
+    <p class="note">This is restricted to
+    <code title="dom-XMLHttpRequest-responseType"><a href="#dom-xmlhttprequest-responsetype">responseType</a></code> being
+    "<code title="">document</code>" in order to prevent breaking legacy
+    content.
 
    <li>
     <p>If <a href="#final-mime-type">final MIME type</a> is <code>text/html</code> let
@@ -2370,8 +2380,6 @@
     the <a href="#response-entity-body">response entity body</a> parsed following the rules set
     forth in the HTML specification for an HTML parser with scripting
     disabled. <a href="#refsHTML">[HTML]</a>
-   </li>
-
 
    <li>
     <p>Otherwise, let <var title="">document</var> be a
@@ -2387,7 +2395,7 @@
     applied.</p> <!-- XXX more formally?! -->
    </li>
 
-   <li><p>Return <var title="">document</var>.</li>
+   <li><p>Return <var title="">document</var>.
   </ol>
 
 
--- a/Overview.src.html	Thu Nov 24 15:54:16 2011 +0100
+++ b/Overview.src.html	Thu Nov 24 16:05:05 2011 +0100
@@ -2293,7 +2293,7 @@
 
    <li><p>Return the result of decoding the
    <span>response entity body</span> using <var>charset</var>. Replace bytes
-   or sequences of bytes that are not valid accordng to the
+   or sequences of bytes that are not valid according to the
    <var>charset</var> with a single
    U+FFFD REPLACEMENT CHARACTER character. Remove one leading
    U+FEFF BYTE ORDER MARK character, if present.
@@ -2304,10 +2304,12 @@
 
   <hr>
 
-  <p>The <dfn id="document-response-entity-body">document response entity
-  body</dfn> is either a <code data-anolis-spec=dom>Document</code> representing the
+  <p>The
+  <dfn id="document-response-entity-body">document response entity body</dfn>
+  is either a <code data-anolis-spec=dom>Document</code> representing the
   <span>response entity body</span> or null. If it is a
-  <code data-anolis-spec=dom>Document</code> its <span data-anolis-spec=html>origin</span> is the
+  <code data-anolis-spec=dom>Document</code>, its
+  <span data-anolis-spec=html>origin</span> is the
   <span><code>XMLHttpRequest</code> origin</span>. If the
   <span>document response entity body</span> has no value assigned to it let
   it be the return value of the following algorithm:</p>
@@ -2319,9 +2321,17 @@
    <li><p>If <span>final MIME type</span> is not null,
    <code>text/html</code>, <code>text/xml</code>,
    <code>application/xml</code>, or does not end in
-   <code title>+xml</code>, return null and terminate these
-   steps.</p></li>
-
+   <code title>+xml</code>, return null and terminate these steps.
+
+   <li>
+    <p>If <code title=dom-XMLHttpRequest-responseType>responseType</code> is
+    the empty string and <span>final MIME type</span> is
+    <code>text/html</code>, return null and terminate these steps.
+
+    <p class=note>This is restricted to
+    <code title=dom-XMLHttpRequest-responseType>responseType</code> being
+    "<code title>document</code>" in order to prevent breaking legacy
+    content.
 
    <li>
     <p>If <span>final MIME type</span> is <code>text/html</code> let
@@ -2329,8 +2339,6 @@
     the <span>response entity body</span> parsed following the rules set
     forth in the HTML specification for an HTML parser with scripting
     disabled. <span data-anolis-ref>HTML</span>
-   </li>
-
 
    <li>
     <p>Otherwise, let <var title>document</var> be a
@@ -2346,7 +2354,7 @@
     applied.</p> <!-- XXX more formally?! -->
    </li>
 
-   <li><p>Return <var title>document</var>.</p></li>
+   <li><p>Return <var title>document</var>.
   </ol>