restrict text/html to responseType being "document"
authorAnne van Kesteren <annevk@opera.com>
Thu, 24 Nov 2011 16:05:05 +0100
changeset 6236face6f073
parent 5 02b3d18a4907
child 7 0a88771ad46e
restrict text/html to responseType being "document"
Overview.html
Overview.src.html
     1.1 --- a/Overview.html	Thu Nov 24 15:54:16 2011 +0100
     1.2 +++ b/Overview.html	Thu Nov 24 16:05:05 2011 +0100
     1.3 @@ -2334,7 +2334,7 @@
     1.4  
     1.5     <li><p>Return the result of decoding the
     1.6     <a href="#response-entity-body">response entity body</a> using <var>charset</var>. Replace bytes
     1.7 -   or sequences of bytes that are not valid accordng to the
     1.8 +   or sequences of bytes that are not valid according to the
     1.9     <var>charset</var> with a single
    1.10     U+FFFD REPLACEMENT CHARACTER character. Remove one leading
    1.11     U+FEFF BYTE ORDER MARK character, if present.
    1.12 @@ -2345,10 +2345,12 @@
    1.13  
    1.14    <hr>
    1.15  
    1.16 -  <p>The <dfn id="document-response-entity-body">document response entity
    1.17 -  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
    1.18 +  <p>The
    1.19 +  <dfn id="document-response-entity-body">document response entity body</dfn>
    1.20 +  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
    1.21    <a href="#response-entity-body">response entity body</a> or null. If it is a
    1.22 -  <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
    1.23 +  <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code>, its
    1.24 +  <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> is the
    1.25    <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a>. If the
    1.26    <a href="#document-response-entity-body">document response entity body</a> has no value assigned to it let
    1.27    it be the return value of the following algorithm:</p>
    1.28 @@ -2360,9 +2362,17 @@
    1.29     <li><p>If <a href="#final-mime-type">final MIME type</a> is not null,
    1.30     <code>text/html</code>, <code>text/xml</code>,
    1.31     <code>application/xml</code>, or does not end in
    1.32 -   <code title="">+xml</code>, return null and terminate these
    1.33 -   steps.</li>
    1.34 -
    1.35 +   <code title="">+xml</code>, return null and terminate these steps.
    1.36 +
    1.37 +   <li>
    1.38 +    <p>If <code title="dom-XMLHttpRequest-responseType"><a href="#dom-xmlhttprequest-responsetype">responseType</a></code> is
    1.39 +    the empty string and <a href="#final-mime-type">final MIME type</a> is
    1.40 +    <code>text/html</code>, return null and terminate these steps.
    1.41 +
    1.42 +    <p class="note">This is restricted to
    1.43 +    <code title="dom-XMLHttpRequest-responseType"><a href="#dom-xmlhttprequest-responsetype">responseType</a></code> being
    1.44 +    "<code title="">document</code>" in order to prevent breaking legacy
    1.45 +    content.
    1.46  
    1.47     <li>
    1.48      <p>If <a href="#final-mime-type">final MIME type</a> is <code>text/html</code> let
    1.49 @@ -2370,8 +2380,6 @@
    1.50      the <a href="#response-entity-body">response entity body</a> parsed following the rules set
    1.51      forth in the HTML specification for an HTML parser with scripting
    1.52      disabled. <a href="#refsHTML">[HTML]</a>
    1.53 -   </li>
    1.54 -
    1.55  
    1.56     <li>
    1.57      <p>Otherwise, let <var title="">document</var> be a
    1.58 @@ -2387,7 +2395,7 @@
    1.59      applied.</p> <!-- XXX more formally?! -->
    1.60     </li>
    1.61  
    1.62 -   <li><p>Return <var title="">document</var>.</li>
    1.63 +   <li><p>Return <var title="">document</var>.
    1.64    </ol>
    1.65  
    1.66  
     2.1 --- a/Overview.src.html	Thu Nov 24 15:54:16 2011 +0100
     2.2 +++ b/Overview.src.html	Thu Nov 24 16:05:05 2011 +0100
     2.3 @@ -2293,7 +2293,7 @@
     2.4  
     2.5     <li><p>Return the result of decoding the
     2.6     <span>response entity body</span> using <var>charset</var>. Replace bytes
     2.7 -   or sequences of bytes that are not valid accordng to the
     2.8 +   or sequences of bytes that are not valid according to the
     2.9     <var>charset</var> with a single
    2.10     U+FFFD REPLACEMENT CHARACTER character. Remove one leading
    2.11     U+FEFF BYTE ORDER MARK character, if present.
    2.12 @@ -2304,10 +2304,12 @@
    2.13  
    2.14    <hr>
    2.15  
    2.16 -  <p>The <dfn id="document-response-entity-body">document response entity
    2.17 -  body</dfn> is either a <code data-anolis-spec=dom>Document</code> representing the
    2.18 +  <p>The
    2.19 +  <dfn id="document-response-entity-body">document response entity body</dfn>
    2.20 +  is either a <code data-anolis-spec=dom>Document</code> representing the
    2.21    <span>response entity body</span> or null. If it is a
    2.22 -  <code data-anolis-spec=dom>Document</code> its <span data-anolis-spec=html>origin</span> is the
    2.23 +  <code data-anolis-spec=dom>Document</code>, its
    2.24 +  <span data-anolis-spec=html>origin</span> is the
    2.25    <span><code>XMLHttpRequest</code> origin</span>. If the
    2.26    <span>document response entity body</span> has no value assigned to it let
    2.27    it be the return value of the following algorithm:</p>
    2.28 @@ -2319,9 +2321,17 @@
    2.29     <li><p>If <span>final MIME type</span> is not null,
    2.30     <code>text/html</code>, <code>text/xml</code>,
    2.31     <code>application/xml</code>, or does not end in
    2.32 -   <code title>+xml</code>, return null and terminate these
    2.33 -   steps.</p></li>
    2.34 -
    2.35 +   <code title>+xml</code>, return null and terminate these steps.
    2.36 +
    2.37 +   <li>
    2.38 +    <p>If <code title=dom-XMLHttpRequest-responseType>responseType</code> is
    2.39 +    the empty string and <span>final MIME type</span> is
    2.40 +    <code>text/html</code>, return null and terminate these steps.
    2.41 +
    2.42 +    <p class=note>This is restricted to
    2.43 +    <code title=dom-XMLHttpRequest-responseType>responseType</code> being
    2.44 +    "<code title>document</code>" in order to prevent breaking legacy
    2.45 +    content.
    2.46  
    2.47     <li>
    2.48      <p>If <span>final MIME type</span> is <code>text/html</code> let
    2.49 @@ -2329,8 +2339,6 @@
    2.50      the <span>response entity body</span> parsed following the rules set
    2.51      forth in the HTML specification for an HTML parser with scripting
    2.52      disabled. <span data-anolis-ref>HTML</span>
    2.53 -   </li>
    2.54 -
    2.55  
    2.56     <li>
    2.57      <p>Otherwise, let <var title>document</var> be a
    2.58 @@ -2346,7 +2354,7 @@
    2.59      applied.</p> <!-- XXX more formally?! -->
    2.60     </li>
    2.61  
    2.62 -   <li><p>Return <var title>document</var>.</p></li>
    2.63 +   <li><p>Return <var title>document</var>.
    2.64    </ol>
    2.65  
    2.66