<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163022] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163022">163022</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-29 09:03:59 -0800 (Wed, 29 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebCore: Have XHR.getResponseHeader() return null and XHR.getAllResponseHeader() return the empty string in initial ready states
https://bugs.webkit.org/show_bug.cgi?id=125840

Patch by Youenn Fablet &lt;youennf@gmail.com&gt; on 2014-01-29
Reviewed by Alexey Proskuryakov.

Merging https://chromium.googlesource.com/chromium/blink/+/d201caf874a0bd6f101f517462b3cf1d8c5fce3d
This patch makes it clear that null/empty string is returned whenever the error flag is set.
This new code path is covered by the added test.

Test: http/tests/xmlhttprequest/response-access-on-error.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::getAllResponseHeaders):
(WebCore::XMLHttpRequest::getResponseHeader):
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:

LayoutTests: Have XHR.getResponseHeader() return null and XHR.getAllResponseHeaders() return empty string in initial ready states
https://bugs.webkit.org/show_bug.cgi?id=125840

Patch by Youenn Fablet &lt;youennf@gmail.com&gt; on 2014-01-29
Reviewed by Alexey Proskuryakov.

Merging https://chromium.googlesource.com/chromium/blink/+/d201caf874a0bd6f101f517462b3cf1d8c5fce3d
The new test exercices the new code path in case xhr received HTTP headers but m_error is set

* http/tests/xmlhttprequest/getAllResponseHeaders-expected.txt:
* http/tests/xmlhttprequest/getAllResponseHeaders.html:
* http/tests/xmlhttprequest/getResponseHeader-expected.txt:
* http/tests/xmlhttprequest/getResponseHeader.html:
* http/tests/xmlhttprequest/response-access-on-error-expected.txt: Added.
* http/tests/xmlhttprequest/response-access-on-error.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestgetAllResponseHeadersexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestgetAllResponseHeadershtml">trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestgetResponseHeaderexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestgetResponseHeaderhtml">trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestcpp">trunk/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequesth">trunk/Source/WebCore/xml/XMLHttpRequest.h</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestidl">trunk/Source/WebCore/xml/XMLHttpRequest.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestresponseaccessonerrorexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestresponseaccessonerrorhtml">trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/LayoutTests/ChangeLog        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-01-29  Youenn Fablet  &lt;youennf@gmail.com&gt;
+
+        Have XHR.getResponseHeader() return null and XHR.getAllResponseHeaders() return empty string in initial ready states
+        https://bugs.webkit.org/show_bug.cgi?id=125840
+
+        Reviewed by Alexey Proskuryakov.
+
+        Merging https://chromium.googlesource.com/chromium/blink/+/d201caf874a0bd6f101f517462b3cf1d8c5fce3d
+        The new test exercices the new code path in case xhr received HTTP headers but m_error is set
+
+        * http/tests/xmlhttprequest/getAllResponseHeaders-expected.txt:
+        * http/tests/xmlhttprequest/getAllResponseHeaders.html:
+        * http/tests/xmlhttprequest/getResponseHeader-expected.txt:
+        * http/tests/xmlhttprequest/getResponseHeader.html:
+        * http/tests/xmlhttprequest/response-access-on-error-expected.txt: Added.
+        * http/tests/xmlhttprequest/response-access-on-error.html: Added.
+
</ins><span class="cx"> 2014-01-29  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r162947): Repaint test results are different between WK1 and WK2
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestgetAllResponseHeadersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders-expected.txt (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders-expected.txt        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders-expected.txt        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -1,10 +1,27 @@
</span><del>-Test page for bug 15356 and bug 29121
</del><ins>+Test the required behavior of XMLHttpRequest.getAllResponseHeaders()
</ins><span class="cx"> 
</span><del>-Assertion: Invoking getAllResponseHeaders method when readyState &gt;= 2 (HEADERS_RECEIVED) should return a conforming list of headers.
</del><ins>+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</ins><span class="cx"> 
</span><del>-PASSED 0
-PASSED 1
-PASSED 2: getAllResponseHeaders returned what looks like a conforming headerlist.
-PASSED 3
-PASSED 4
</del><span class="cx"> 
</span><ins>+PASS {state: 0}; headerValues = xhr.getAllResponseHeaders(); did not throw exception.
+PASS headerValues is the empty string
+PASS {state: 1}; headerValues = xhr.getAllResponseHeaders(); did not throw exception.
+PASS headerValues is the empty string
+PASS getAllResponseHeaders() result is empty in ready state 1.
+PASS xhr.open(&quot;GET&quot;, &quot;resources/1251.html&quot;, true); did not throw exception.
+PASS {state: 1}; headerValues = xhr.getAllResponseHeaders(); did not throw exception.
+PASS headerValues is the empty string
+PASS xhr.send(null); did not throw exception.
+PASS {state: 2}; headerValues = xhr.getAllResponseHeaders(); did not throw exception.
+PASS headerValues is not the empty string
+PASS Header values appears to be conforming.
+PASS {state: 3}; headerValues = xhr.getAllResponseHeaders(); did not throw exception.
+PASS headerValues is not the empty string
+PASS responseHeaders is savedHeaders
+PASS {state: 4}; headerValues = xhr.getAllResponseHeaders(); did not throw exception.
+PASS headerValues is not the empty string
+PASS responseHeaders is savedHeaders
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestgetAllResponseHeadershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders.html (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders.html        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/getAllResponseHeaders.html        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -1,118 +1,69 @@
</span><ins>+&lt;!doctype html&gt;
</ins><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-    &lt;title&gt;Check exception thrown by getAllResponseHeaders and some
-    characteristics of the return value&lt;/title&gt;
</del><ins>+&lt;title&gt;Testing XMLHttpRequest.getReponseHeader behavior&lt;/title&gt;
+&lt;script src=&quot;/js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;
</span><ins>+description(&quot;Test the required behavior of XMLHttpRequest.getAllResponseHeaders()&quot;);
</ins><span class="cx"> 
</span><del>-function log (msg) {
-    var paragraph = document.createElement(&quot;li&quot;);
-    paragraph.innerHTML=msg.replace(/\n/gm,&quot;&lt;br&gt;&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(paragraph);
-}
</del><ins>+window.jsTestIsAsync = true;
</ins><span class="cx"> 
</span><del>-var xhr;
</del><ins>+var xhr = new XMLHttpRequest();
</ins><span class="cx"> 
</span><del>-if (window.XMLHttpRequest) {
-    xhr = new XMLHttpRequest();
-} else {
-    try {
-        xhr = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
-    } catch (ex) {
-        xhr = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
-    }
</del><ins>+var savedHeaders = null;
+
+var headerValues;
+function testGetAllResponseHeaders(xhr, expectEmpty) {
+    shouldNotThrow(&quot;{state: &quot; + xhr.readyState + &quot;}; headerValues = xhr.getAllResponseHeaders();&quot;);
+    if (expectEmpty &amp;&amp; headerValues !== &quot;&quot;)
+        testFailed(&quot;Expected the empty string, got: '&quot; + headerValues + &quot;'&quot;);
+    else
+        testPassed(&quot;headerValues is &quot; + (!expectEmpty ? &quot;not &quot; : &quot;&quot;) + &quot;the empty string&quot;);
+    return headerValues;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-var savedHeader = null;
</del><ins>+var responseHeaders;
</ins><span class="cx"> xhr.onreadystatechange = function() {
</span><span class="cx">     var rState = this.readyState;
</span><del>-    // We expect an INVALID_STATE_ERR exception for readyState &lt; 2
-    // and no exception for readyState &gt;= 2
-    try {
-        var header = this.getAllResponseHeaders();
-        if (rState != this.readyState)
-            log(&quot;UNCERTAIN &quot; + rState + &quot;: readyState changed while getting headers.&quot;);
-        if (rState &lt; 2) {
-            log(&quot;FAILED &quot; + rState + &quot;: headerlist=&quot; + header);
-        } else if (header)
-            if (savedHeader)
-                if (savedHeader != header) {
-                    log(&quot;FAILED &quot; + rState +
-&quot;: headerlist changed after it was first returned. Previous header list:\n&quot;
-+ savedHeader + &quot;\n New headerlist:\n&quot; + header);
-                savedHeader = header;
-                } 
-                else //savedHeader == header here; no need to reprint header
-                    log(&quot;PASSED &quot; + rState);
-            else {//first header list retrieved
-                if (/^Set-Cookie:|^Set-Cookie2:/im.test(header))
-                    log(&quot;FAILED &quot; + rState +
-&quot;: /^Set-Cookie:|^Set-Cookie2:/ matches. getAllResponseHeaders returned:\n&quot; + header);
-                else if (window.testRunner)
-//do not print list for automated tests to avoid false failures.
-                    log(&quot;PASSED &quot; + rState +
-&quot;: getAllResponseHeaders returned what looks like a conforming headerlist.&quot;);
</del><ins>+    responseHeaders = testGetAllResponseHeaders(this, rState &lt;= XMLHttpRequest.OPENED);
+    if (responseHeaders) {
+        if (savedHeaders) {
+            shouldBe(&quot;responseHeaders&quot;, &quot;savedHeaders&quot;);
+        } else {
+            if (/^Set-Cookie:|^Set-Cookie2:/im.test(responseHeaders)) {
+                testFailed(&quot;Did not expect to find a Set-Cookie{2} header, got: '&quot; + responseHeaders + &quot;'&quot;);
+            } else {
+                // Do not print list for automated tests to avoid false failures.
+                if (self.testRunner)
+                    testPassed(&quot;Header values appears to be conforming.&quot;);
</ins><span class="cx">                 else
</span><del>-                    log(&quot;PASSED &quot; + rState +
-&quot;: getAllResponseHeaders returned:\n&quot; + header);
-                savedHeader = header;
</del><ins>+                    testPassed(&quot;Header values appears ok: &quot; + JSON.stringify(headerValues));
</ins><span class="cx">             }
</span><del>-        else //header is null
-            log(&quot;FAILED &quot; + rState + &quot;: null header list returned&quot;);
-    } catch (e) {
-        if (rState &lt; 2) {
-            log(&quot;PASSED &quot; + rState);
-        } else {
-            log(&quot;FAILED &quot; + rState + &quot;: EXCEPTION THROWN: &quot; + e.message + &quot;.&quot;);
</del><span class="cx">         }
</span><ins>+        savedHeaders = responseHeaders;
+    } else {
+        if (rState &gt; XMLHttpRequest.OPENED)
+            testFailed(&quot;In ready state &quot; + rState + &quot;, unexpected empty value.&quot;);
+        else if (responseHeaders !== &quot;&quot;)
+            testFailed(&quot;In ready state &quot; + rState + &quot;, expected the empty string, got: &quot; + JSON.stringify(responseHeaders) + &quot;.&quot;);
+        else
+            testPassed(&quot;getAllResponseHeaders() result is empty in ready state &quot; + rState + &quot;.&quot;);
</ins><span class="cx">     }
</span><del>-    if ((rState == 4) &amp;&amp; (window.testRunner))
-            testRunner.notifyDone();
</del><ins>+
+    if (rState == XMLHttpRequest.DONE)
+        finishJSTest();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-function test() {
-    if (window.testRunner) {
-        testRunner.waitUntilDone();
-        testRunner.dumpAsText();
-    }
</del><ins>+function runTest() {
</ins><span class="cx">     // Test for readyState = 0
</span><del>-    try {
-        var header = xhr.getAllResponseHeaders();
-        log(&quot;FAILED &quot; + xhr.readyState + &quot;: header=&quot; + header);
-    } catch (e) {
-        log(&quot;PASSED &quot; + xhr.readyState);
-    }
-    try {
-        xhr.open(&quot;GET&quot;,&quot;resources/1251.html&quot;, true);
-        xhr.send(null);
-    } catch(e) {
-        log(&quot;FAILED open/send: EXCEPTION THROWN: &quot; + e.message +&quot;.&quot;);
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
</del><ins>+    testGetAllResponseHeaders(xhr, true);
+    shouldNotThrow('xhr.open(&quot;GET&quot;, &quot;resources/1251.html&quot;, true);');
+    // Test for readyState = 1
+    testGetAllResponseHeaders(xhr, true);
+    shouldNotThrow(&quot;xhr.send(null);&quot;);
</ins><span class="cx"> }
</span><ins>+runTest();
</ins><span class="cx"> &lt;/script&gt;
</span><ins>+&lt;script src=&quot;/js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><del>-&lt;body onload=&quot;test()&quot;&gt;
-
-&lt;p&gt;Test page for &lt;a href=&quot;http://bugs.webkit.org/show_bug.cgi?id=15356&quot;&gt;bug 15356&lt;/a&gt;
-and &lt;a href=&quot;http://bugs.webkit.org/show_bug.cgi?id=29121&quot;&gt;bug 29121&lt;/a&gt;&lt;/p&gt;
-&lt;p&gt;Assertion: Invoking getAllResponseHeaders method when readyState &gt;= 2
-(HEADERS_RECEIVED) should return a conforming list of headers.&lt;/p&gt;
-&lt;script&gt;
-    if (!window.testRunner)
-        document.write(&quot;&lt;p&gt;If the test passes one should see \
-below the ruler the text \&quot;passed\&quot; in all capital letters, 5 times, \
-followed each time by a space and the readyState number.&lt;/p&gt;\n\
-&lt;p&gt;ReadyStatenumbers should be in ascending order 0 to 4.&lt;/p&gt;\n\
-&lt;p&gt;A conforming list of response headers should also be printed.&lt;/p&gt;\n\
-&lt;p&gt;A conforming list of headers:&lt;/p&gt; \
-   &lt;li&gt; contains one header per line.&lt;/li&gt; \
-   &lt;li&gt; has header names and header values separated by a COLON and \
-a SPACE.&lt;/li&gt;\
-   &lt;li&gt; does not contain any headers that match (case-insensitively) \
-Set-Cookie or Set-Cookie2&lt;/li&gt;&quot;);
- &lt;/script&gt;
- &lt;hr&gt;
- &lt;p&gt;&lt;ol id=console&gt;&lt;/ol&gt;&lt;/p&gt;
-&lt;/body&gt;
</del><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestgetResponseHeaderexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader-expected.txt (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader-expected.txt        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader-expected.txt        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -4,35 +4,59 @@
</span><span class="cx"> CONSOLE MESSAGE: Refused to get unsafe header &quot;sEt-coOkIE2&quot;
</span><span class="cx"> CONSOLE MESSAGE: Refused to get unsafe header &quot;SeT-COoKie&quot;
</span><span class="cx"> CONSOLE MESSAGE: Refused to get unsafe header &quot;sEt-coOkIE2&quot;
</span><del>-Test page for bug 15356 and bug 29121
</del><ins>+Test the required behavior of XMLHttpRequest.getResponseHeader()
</ins><span class="cx"> 
</span><del>-Assertion: Invoking the getResponseHeader method when readyState &gt;= 2 (HEADERS_RECEIVED) returns a header value if the header exists.
</del><ins>+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</ins><span class="cx"> 
</span><del>-Assertion: Invoking the getResponseHeader method with the parameter satisfying the following conditions causes getResponseHeader to return null:
</del><span class="cx"> 
</span><del>-1a. The parameter case-insensitively matches Set-Cookie;
-1b. The parameter case-insensitively matches Set-Cookie2;
-2. The parameter does not match any header in the response;
-3a. The parameter is null (it is not a valid header name);
-3b. The parameter is &quot;Content-Type:&quot; (it is not a valid header name).
-PASSED 0 Content-Type: exception thrown.
-PASSED 1 Content-Type: exception thrown
-PASSED 2 Content-Type: ResponseHeader(Content-Type) returned a value.
-PASSED 2 SeT-COoKie: getResponseHeader(SeT-COoKie) returned null.
-PASSED 2 sEt-coOkIE2: getResponseHeader(sEt-coOkIE2) returned null.
-PASSED 2 xxx-mytest-headerabc: getResponseHeader(xxx-mytest-headerabc) returned null.
-PASSED 2 null: getResponseHeader(null) returned null.
-PASSED 2 Content-Type:: getResponseHeader(Content-Type:) returned null.
-PASSED 3 Content-Type: Content-Type
-PASSED 3 SeT-COoKie: getResponseHeader(SeT-COoKie) returned null.
-PASSED 3 sEt-coOkIE2: getResponseHeader(sEt-coOkIE2) returned null.
-PASSED 3 xxx-mytest-headerabc: getResponseHeader(xxx-mytest-headerabc) returned null.
-PASSED 3 null: getResponseHeader(null) returned null.
-PASSED 3 Content-Type:: getResponseHeader(Content-Type:) returned null.
-PASSED 4 Content-Type: Content-Type
-PASSED 4 SeT-COoKie: getResponseHeader(SeT-COoKie) returned null.
-PASSED 4 sEt-coOkIE2: getResponseHeader(sEt-coOkIE2) returned null.
-PASSED 4 xxx-mytest-headerabc: getResponseHeader(xxx-mytest-headerabc) returned null.
-PASSED 4 null: getResponseHeader(null) returned null.
-PASSED 4 Content-Type:: getResponseHeader(Content-Type:) returned null.
</del><ins>+PASS {state: 0}; headerValue = xhr.getResponseHeader('Content-Type'); did not throw exception.
+PASS headerValue is null
+PASS {state: 1}; headerValue = xhr.getResponseHeader('Content-Type'); did not throw exception.
+PASS headerValue is null
+PASS Header 'Content-Type' is null in ready state 1.
+PASS xhr.open(&quot;GET&quot;, &quot;resources/1251.html&quot;, true); did not throw exception.
+PASS {state: 1}; headerValue = xhr.getResponseHeader('Content-Type'); did not throw exception.
+PASS headerValue is null
+PASS xhr.send(null); did not throw exception.
+PASS {state: 2}; headerValue = xhr.getResponseHeader('Content-Type'); did not throw exception.
+PASS headerValue is non-null.
+PASS {state: 2}; headerValue = xhr.getResponseHeader('SeT-COoKie'); did not throw exception.
+PASS headerValue is null
+PASS {state: 2}; headerValue = xhr.getResponseHeader('sEt-coOkIE2'); did not throw exception.
+PASS headerValue is null
+PASS {state: 2}; headerValue = xhr.getResponseHeader('xxx-mytest-headerabc'); did not throw exception.
+PASS headerValue is null
+PASS {state: 2}; headerValue = xhr.getResponseHeader('null'); did not throw exception.
+PASS headerValue is null
+PASS {state: 2}; headerValue = xhr.getResponseHeader('Content-Type:'); did not throw exception.
+PASS headerValue is null
+PASS {state: 3}; headerValue = xhr.getResponseHeader('Content-Type'); did not throw exception.
+PASS headerValue is non-null.
+PASS result is savedHeader
+PASS {state: 3}; headerValue = xhr.getResponseHeader('SeT-COoKie'); did not throw exception.
+PASS headerValue is null
+PASS {state: 3}; headerValue = xhr.getResponseHeader('sEt-coOkIE2'); did not throw exception.
+PASS headerValue is null
+PASS {state: 3}; headerValue = xhr.getResponseHeader('xxx-mytest-headerabc'); did not throw exception.
+PASS headerValue is null
+PASS {state: 3}; headerValue = xhr.getResponseHeader('null'); did not throw exception.
+PASS headerValue is null
+PASS {state: 3}; headerValue = xhr.getResponseHeader('Content-Type:'); did not throw exception.
+PASS headerValue is null
+PASS {state: 4}; headerValue = xhr.getResponseHeader('Content-Type'); did not throw exception.
+PASS headerValue is non-null.
+PASS result is savedHeader
+PASS {state: 4}; headerValue = xhr.getResponseHeader('SeT-COoKie'); did not throw exception.
+PASS headerValue is null
+PASS {state: 4}; headerValue = xhr.getResponseHeader('sEt-coOkIE2'); did not throw exception.
+PASS headerValue is null
+PASS {state: 4}; headerValue = xhr.getResponseHeader('xxx-mytest-headerabc'); did not throw exception.
+PASS headerValue is null
+PASS {state: 4}; headerValue = xhr.getResponseHeader('null'); did not throw exception.
+PASS headerValue is null
+PASS {state: 4}; headerValue = xhr.getResponseHeader('Content-Type:'); did not throw exception.
+PASS headerValue is null
+PASS successfullyParsed is true
</ins><span class="cx"> 
</span><ins>+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestgetResponseHeaderhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader.html (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader.html        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/getResponseHeader.html        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -1,140 +1,69 @@
</span><ins>+&lt;!doctype html&gt;
</ins><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-    &lt;title&gt;Check exception thrown by getReponseHeader &lt;/title&gt;
</del><ins>+&lt;title&gt;Testing XMLHttpRequest.getReponseHeader behavior&lt;/title&gt;
+&lt;script src=&quot;/js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;
</span><ins>+description(&quot;Test the required behavior of XMLHttpRequest.getResponseHeader()&quot;);
</ins><span class="cx"> 
</span><ins>+window.jsTestIsAsync = true;
+
</ins><span class="cx"> var savedHeader = null;
</span><del>-var headerName=&quot;Content-Type&quot;;
-var nullTests =  new Array(&quot;SeT-COoKie&quot;, &quot;sEt-coOkIE2&quot;, 
-    &quot;xxx-mytest-headerabc&quot;, null, &quot;Content-Type:&quot;);
</del><ins>+var headerName = &quot;Content-Type&quot;;
+var nullTests = [ &quot;SeT-COoKie&quot;,
+                  &quot;sEt-coOkIE2&quot;,
+                  &quot;xxx-mytest-headerabc&quot;,
+                  null,
+                  &quot;Content-Type:&quot; ];
</ins><span class="cx"> 
</span><del>-function log (msg) {
-    var paragraph = document.createElement(&quot;li&quot;);
-    paragraph.innerHTML=msg.replace(/\n/gm,&quot;&lt;br&gt;&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(paragraph);
-}
</del><ins>+var xhr = new XMLHttpRequest();
</ins><span class="cx"> 
</span><del>-function log4(status, rState, subState, msg) {
-    log(status + &quot; &quot; + rState + &quot; &quot; + subState + &quot;: &quot; + msg);
-}
</del><ins>+var headerValue;
+function testGetResponseHeader(xhr, headerName, expectNull) {
+    shouldNotThrow(&quot;{state: &quot; + xhr.readyState + &quot;}; headerValue = xhr.getResponseHeader('&quot; + headerName + &quot;');&quot;);
+    if (expectNull)
+        shouldBeNull(&quot;headerValue&quot;);
+    else
+        shouldBeNonNull(&quot;headerValue&quot;);
</ins><span class="cx"> 
</span><del>-function log3(status, rState, msg) {
-    log4(status, rState, headerName, msg);
</del><ins>+    return headerValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-if (window.XMLHttpRequest) {
-    xhr = new XMLHttpRequest();
-} else {
-    try {
-        xhr = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
-    } catch (ex) {
-        xhr = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
-    }
-}
-
</del><ins>+var result;
</ins><span class="cx"> xhr.onreadystatechange = function() {
</span><span class="cx">     var rState = this.readyState;
</span><del>-    // We expect an INVALID_STATE_ERR exception for readyState &lt; 2
-    // and no exception for readyState &gt;= 2
-    try {
-        var header = this.getResponseHeader(headerName);
-        if (rState != this.readyState)
-            log3(&quot;UNCERTAIN&quot;, rState, &quot;readyState changed while getting the header.&quot;);
-        if (rState &lt; 2) {
-            log3(&quot;FAILED&quot;, rState, headerName + &quot;=&quot; + header);
-        } else if (header) {
-            if (savedHeader)
-                if (savedHeader != header) {
-                    log3(&quot;FAILED&quot;, rState,headerName + &quot; changed after it was first returned. Previous &quot; + headerName
-                        + &quot;=&quot; + savedHeader + &quot;; New &quot; + headerName + &quot;=&quot; + header + &quot;.&quot;);
-                savedHeader = header;
-                } 
-                else //savedHeader == header here; no need to reprint header
-                    log3(&quot;PASSED&quot;, rState, headerName);
-            else {//first header value retrieved
-                if (window.testRunner)
-//do not print the header's value for automated tests to avoid false failures.
-                    log3(&quot;PASSED&quot;, rState, &quot;ResponseHeader(&quot; + headerName + &quot;) returned a value.&quot;);
-                else
-                    log3(&quot;PASSED&quot;, rState, &quot;getResponseHeader(&quot; + headerName + &quot;) returned: &quot; + header + &quot;.&quot;);
-                savedHeader = header;
-            }
-            for (var i=0;i&lt;nullTests.length;++i) {
-                try {
-                    var str = this.getResponseHeader(nullTests[i]);
-                    if (str == null)
-                        log4(&quot;PASSED&quot;, rState, nullTests[i], &quot;getResponseHeader(&quot; + nullTests[i] +
-                            &quot;) returned null.&quot;);
-                    else
-                        log4(&quot;FAILED&quot;, rState, nullTests[i], &quot;getResponseHeader(&quot; + nullTests[i] +
-                            &quot;) returned \&quot;&quot; + str + &quot;\&quot;&quot;);
-                } catch(e) {
-                    log4(&quot;FAILED&quot;, rState, nullTests[i], &quot;getResponseHeader(&quot; + nullTests[i] + &quot;) threw exception:&quot; + e);
-                }
-            }
-        }
-        else //header is null
-            log3(&quot;FAILED&quot;, rState, &quot;null &quot; + headerName + &quot; returned.&quot;);
-    } catch (e) {
-        if (rState &lt; 2)
-            log3(&quot;PASSED&quot;, rState, &quot;exception thrown&quot;);
</del><ins>+    result = testGetResponseHeader(this, headerName, rState &lt;= XMLHttpRequest.OPENED);
+    if (result) {
+        if (savedHeader)
+            shouldBe(&quot;result&quot;, &quot;savedHeader&quot;);
+
+        savedHeader = result;
+
+        for (var i = 0; i &lt; nullTests.length; ++i)
+            testGetResponseHeader(this, nullTests[i], true);
+    } else {
+        if (rState &gt; XMLHttpRequest.OPENED)
+            testFailed(&quot;In ready state &quot; + rState + &quot;, unexpected null value for '&quot; + headerName + &quot;'.&quot;);
+        else if (result !== null)
+            testFailed(&quot;In ready state &quot; + rState + &quot;, expected null for '&quot; + headerName + &quot;, got: &quot; + JSON.stringify(result) + &quot;.&quot;);
</ins><span class="cx">         else
</span><del>-            log3(&quot;FAILED&quot;, rState, &quot;exception thrown: &quot; + e.message + &quot;.&quot;);
</del><ins>+            testPassed(&quot;Header '&quot; + headerName + &quot;' is null in ready state &quot; + rState + &quot;.&quot;);
</ins><span class="cx">     }
</span><del>-    if ((rState == 4) &amp;&amp; (window.testRunner))
-            testRunner.notifyDone();
-}
</del><span class="cx"> 
</span><del>-if (window.testRunner) {
-    testRunner.waitUntilDone();
-    testRunner.dumpAsText();
</del><ins>+    if (rState == XMLHttpRequest.DONE)
+        finishJSTest();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-function test() {
</del><ins>+function runTest() {
</ins><span class="cx">     // Test for readyState = 0
</span><del>-    try {
-        var header = xhr.getResponseHeader(headerName);
-        log3(&quot;FAILED&quot;, xhr.readyState, headerName + &quot;=&quot; + header + &quot;.&quot;);
-    } catch (e) {
-        log3(&quot;PASSED&quot;, xhr.readyState, &quot;exception thrown.&quot;);
-    }
-    try {
-        xhr.open(&quot;GET&quot;,&quot;resources/1251.html&quot;, true);
-        xhr.send(null);
-    } catch(e) {
-        log3(&quot;FAILED&quot;, &quot;open/send&quot;, &quot;exception thrown: &quot; + e.message +&quot;.&quot;);
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
</del><ins>+    testGetResponseHeader(xhr, headerName, true);
+    shouldNotThrow('xhr.open(&quot;GET&quot;, &quot;resources/1251.html&quot;, true);');
+    // Test for readyState = 1
+    testGetResponseHeader(xhr, headerName, true);
+    shouldNotThrow(&quot;xhr.send(null);&quot;);
</ins><span class="cx"> }
</span><ins>+runTest();
</ins><span class="cx"> &lt;/script&gt;
</span><ins>+&lt;script src=&quot;/js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><del>-&lt;body onload=&quot;test()&quot;&gt;
-
-&lt;p&gt;Test page for &lt;a href=&quot;http://bugs.webkit.org/show_bug.cgi?id=15356&quot;&gt;bug
-15356&lt;/a&gt;
-and &lt;a href=&quot;http://bugs.webkit.org/show_bug.cgi?id=29121&quot;&gt;bug 29121&lt;/a&gt;&lt;/p&gt;
-&lt;p&gt;Assertion: Invoking the getResponseHeader method when readyState &gt;= 2
-(HEADERS_RECEIVED) returns a header value if the header exists.&lt;/p&gt;
-&lt;p&gt;Assertion: Invoking the getResponseHeader method with the parameter
-    satisfying the following conditions causes getResponseHeader
-    to return null:
-&lt;li&gt;1a. The parameter case-insensitively matches Set-Cookie;&lt;/li&gt;
-&lt;li&gt;1b. The parameter case-insensitively matches Set-Cookie2;&lt;/li&gt;
-&lt;li&gt;2.  The parameter does not match any header in the response;&lt;/li&gt;
-&lt;li&gt;3a. The parameter is null (it is not a valid header name);&lt;/li&gt;
-&lt;li&gt;3b. The parameter is &quot;Content-Type:&quot; (it is not a valid header name).&lt;/li&gt;
-
-&lt;script&gt;
-    if (!window.testRunner)
-        document.write(&quot;&lt;p&gt;If the test passes one should see \
-below the ruler the text \&quot;passed\&quot; in all capital letters, once for every ready state &amp;lt; 2, \
-followed each time by a space and the readyState number and 6 times for every ready state &gt;= 2.&lt;/p&gt;\n\
-&lt;p&gt;ReadyState numbers should be in ascending order 0 to 4.&lt;/p&gt;\n\
-&lt;p&gt;ReadyState numbers should be followed by a blank, the name of the header tested, colon a space and a message.&lt;/p&gt;\
-&lt;p&gt;The value of the &quot; + headerName + &quot; header should  be printed for ready state 2.&lt;/p&gt;&quot;);
-&lt;/script&gt;
- &lt;hr&gt;
- &lt;p&gt;&lt;ol id=console&gt;&lt;/ol&gt;&lt;/p&gt;
-&lt;/body&gt;
</del><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestresponseaccessonerrorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error-expected.txt (0 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error-expected.txt        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+XMLHttpRequest: ensure that response getters properly handle error cases (see bug 125840)
+
+PASS error test 
+PASS abort test 
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestresponseaccessonerrorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error.html (0 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/response-access-on-error.html        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;title&gt;XMLHttpRequest: ensure that response getters properly handle error cases&lt;/title&gt;
+    &lt;script src=&quot;/js-test-resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/js-test-resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+    &lt;div&gt;XMLHttpRequest: ensure that response getters properly handle error cases (see &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=125840&quot;&gt;bug 125840&lt;/a&gt;)&lt;/div&gt;
+    &lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+
+    &lt;script type=&quot;text/javascript&quot;&gt;
+        // These two tests check response getters when error flag is set and state is DONE
+        var test1 = async_test(&quot;error test&quot;)
+        test1.step(function() {
+
+            var xhr = new XMLHttpRequest()
+            xhr.onerror = test1.step_func(function(e)
+            {
+                assert_response(xhr)
+                test1.done()
+            })
+            xhr.open(&quot;GET&quot;, &quot;resources/infinite-loop.php&quot;, true)
+            xhr.send(&quot;&quot;)
+        })
+
+        var test2 = async_test(&quot;abort test&quot;)
+        test2.step(function() {
+            var xhr = new XMLHttpRequest()
+            xhr.upload.onloadend = function(e) {
+                xhr.abort()
+            }
+            xhr.onreadystatechange = test2.step_func(function(e) {
+                if (xhr.readyState == xhr.DONE) {
+                    assert_response(xhr)
+                    test2.done()
+                 }
+            })
+            xhr.open(&quot;POST&quot;, &quot;resources/post-echo.cgi&quot;, true)
+            xhr.setRequestHeader(&quot;Content-Type&quot;,&quot;text/plain&quot;)
+            xhr.send(&quot;data&quot;)
+        })
+        
+        function assert_response(xhr) {
+            assert_equals(xhr.getAllResponseHeaders().trim(), &quot;&quot;, &quot;getAllResponseHeaders should return the empty string&quot;)
+            assert_equals(xhr.getResponseHeader(&quot;Content-Type&quot;), null, &quot;getResponseHeader should return null&quot;)
+        }
+    &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/Source/WebCore/ChangeLog        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-01-29  Youenn Fablet  &lt;youennf@gmail.com&gt;
+
+        Have XHR.getResponseHeader() return null and XHR.getAllResponseHeader() return the empty string in initial ready states
+        https://bugs.webkit.org/show_bug.cgi?id=125840
+
+        Reviewed by Alexey Proskuryakov.
+
+        Merging https://chromium.googlesource.com/chromium/blink/+/d201caf874a0bd6f101f517462b3cf1d8c5fce3d
+        This patch makes it clear that null/empty string is returned whenever the error flag is set.
+        This new code path is covered by the added test.
+        
+        Test: http/tests/xmlhttprequest/response-access-on-error.html
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::getAllResponseHeaders):
+        (WebCore::XMLHttpRequest::getResponseHeader):
+        * xml/XMLHttpRequest.h:
+        * xml/XMLHttpRequest.idl:
+
</ins><span class="cx"> 2014-01-29  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r162947): Repaint test results are different between WK1 and WK2
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -986,12 +986,10 @@
</span><span class="cx">     return m_requestHeaders.get(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String XMLHttpRequest::getAllResponseHeaders(ExceptionCode&amp; ec) const
</del><ins>+String XMLHttpRequest::getAllResponseHeaders() const
</ins><span class="cx"> {
</span><del>-    if (m_state &lt; HEADERS_RECEIVED) {
-        ec = INVALID_STATE_ERR;
</del><ins>+    if (m_state &lt; HEADERS_RECEIVED || m_error)
</ins><span class="cx">         return &quot;&quot;;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     StringBuilder stringBuilder;
</span><span class="cx"> 
</span><span class="lines">@@ -1022,12 +1020,10 @@
</span><span class="cx">     return stringBuilder.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String XMLHttpRequest::getResponseHeader(const AtomicString&amp; name, ExceptionCode&amp; ec) const
</del><ins>+String XMLHttpRequest::getResponseHeader(const AtomicString&amp; name) const
</ins><span class="cx"> {
</span><del>-    if (m_state &lt; HEADERS_RECEIVED) {
-        ec = INVALID_STATE_ERR;
</del><ins>+    if (m_state &lt; HEADERS_RECEIVED || m_error)
</ins><span class="cx">         return String();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     // See comment in getAllResponseHeaders above.
</span><span class="cx">     if (isSetCookieHeader(name) &amp;&amp; !securityOrigin()-&gt;canLoadLocalResources()) {
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.h        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -105,8 +105,8 @@
</span><span class="cx">     void setRequestHeader(const AtomicString&amp; name, const String&amp; value, ExceptionCode&amp;);
</span><span class="cx">     void overrideMimeType(const String&amp; override);
</span><span class="cx">     bool doneWithoutErrors() const { return !m_error &amp;&amp; m_state == DONE; }
</span><del>-    String getAllResponseHeaders(ExceptionCode&amp;) const;
-    String getResponseHeader(const AtomicString&amp; name, ExceptionCode&amp;) const;
</del><ins>+    String getAllResponseHeaders() const;
+    String getResponseHeader(const AtomicString&amp; name) const;
</ins><span class="cx">     String responseText(ExceptionCode&amp;);
</span><span class="cx">     String responseTextIgnoringResponseType() const { return m_responseBuilder.toStringPreserveCapacity(); }
</span><span class="cx">     Document* responseXML(ExceptionCode&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.idl (163021 => 163022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.idl        2014-01-29 16:26:31 UTC (rev 163021)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.idl        2014-01-29 17:03:59 UTC (rev 163022)
</span><span class="lines">@@ -80,8 +80,8 @@
</span><span class="cx">     readonly attribute XMLHttpRequestUpload upload;
</span><span class="cx"> 
</span><span class="cx">     // response
</span><del>-    [TreatReturnedNullStringAs=Undefined, RaisesException] DOMString getAllResponseHeaders();
-    [TreatReturnedNullStringAs=Null, RaisesException] DOMString getResponseHeader(DOMString header);
</del><ins>+    [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders();
+    [TreatReturnedNullStringAs=Null] DOMString getResponseHeader(DOMString header);
</ins><span class="cx">     [GetterRaisesException, CustomGetter] readonly attribute DOMString responseText; // The custom getter implements TreatReturnedNullStringAs=Null
</span><span class="cx">     [GetterRaisesException] readonly attribute Document responseXML;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>