<!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>[161051] 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/161051">161051</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-24 00:05:56 -0800 (Tue, 24 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>XMLHttpRequest: status and statusText throw DOM Exception 11 when the state is UNSENT or OPENED.
https://bugs.webkit.org/show_bug.cgi?id=45994
Reviewed by Alexey Proskuryakov.
Source/WebCore:
Merged https://chromium.googlesource.com/chromium/blink/+/23c90460de16e04c5aba7ed942fba76cb79fdb9b.
Latest XHR spec says that XHR should return 0 and an empty string when it's in UNSENT or OPENED state
or error flag is set: http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/#the-status-attribute
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::status):
(WebCore::XMLHttpRequest::statusText):
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:
LayoutTests:
Rebaselined and fixed tests as done in https://chromium.googlesource.com/chromium/blink/+/23c90460de16e04c5aba7ed942fba76cb79fdb9b.
* http/tests/xmlhttprequest/exceptions-expected.txt:
* http/tests/xmlhttprequest/exceptions.html:
* http/tests/xmlhttprequest/status-after-abort-expected.txt:
* http/tests/xmlhttprequest/zero-length-response-expected.txt:
* js/dom/dfg-custom-getter-throw-expected.txt:
* js/dom/script-tests/dfg-custom-getter-throw-inlined.js: Fixed the test.
(foo): Use responseText instead of status so that it throws when responseType is "arraybuffer".
(bar): Set responseType to "arraybuffer" to cause an exception to be thrown.
* js/dom/script-tests/dfg-custom-getter-throw.js: Ditto.
(foo):
(bar):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestexceptionsexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestexceptionshtml">trunk/LayoutTests/http/tests/xmlhttprequest/exceptions.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequeststatusafterabortexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/status-after-abort-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestzerolengthresponseexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgcustomgetterthrowexpectedtxt">trunk/LayoutTests/js/dom/dfg-custom-getter-throw-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomscripttestsdfgcustomgetterthrowinlinedjs">trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw-inlined.js</a></li>
<li><a href="#trunkLayoutTestsjsdomscripttestsdfgcustomgetterthrowjs">trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw.js</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>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/ChangeLog        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2013-12-23 Ryosuke Niwa <rniwa@webkit.org>
+
+ XMLHttpRequest: status and statusText throw DOM Exception 11 when the state is UNSENT or OPENED.
+ https://bugs.webkit.org/show_bug.cgi?id=45994
+
+ Reviewed by Alexey Proskuryakov.
+
+ Rebaselined and fixed tests as done in https://chromium.googlesource.com/chromium/blink/+/23c90460de16e04c5aba7ed942fba76cb79fdb9b.
+
+ * http/tests/xmlhttprequest/exceptions-expected.txt:
+ * http/tests/xmlhttprequest/exceptions.html:
+ * http/tests/xmlhttprequest/status-after-abort-expected.txt:
+ * http/tests/xmlhttprequest/zero-length-response-expected.txt:
+
+ * js/dom/dfg-custom-getter-throw-expected.txt:
+ * js/dom/script-tests/dfg-custom-getter-throw-inlined.js: Fixed the test.
+ (foo): Use responseText instead of status so that it throws when responseType is "arraybuffer".
+ (bar): Set responseType to "arraybuffer" to cause an exception to be thrown.
+ * js/dom/script-tests/dfg-custom-getter-throw.js: Ditto.
+ (foo):
+ (bar):
+
</ins><span class="cx"> 2013-12-23 Mihnea Ovidenie <mihnea@adobe.com>
</span><span class="cx">
</span><span class="cx"> [CSSRegions] Fix fast/regions/assert-flow-thread-compositing.html test description
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestexceptionsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -6,8 +6,6 @@
</span><span class="cx"> open()
</span><span class="cx"> PASS: req.setRequestHeader() threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS: req.setRequestHeader("Foo") threw exception TypeError: Not enough arguments.
</span><del>-PASS: req.status() threw exception Error: InvalidStateError: DOM Exception 11.
-PASS: req.statusText() threw exception Error: InvalidStateError: DOM Exception 11.
</del><span class="cx"> send()
</span><span class="cx"> PASS: req.send(null) threw exception Error: InvalidStateError: DOM Exception 11.
</span><span class="cx"> PASS: req.setRequestHeader("Foo", "bar") threw exception Error: InvalidStateError: DOM Exception 11.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestexceptionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/exceptions.html (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/exceptions.html        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/exceptions.html        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -64,8 +64,6 @@
</span><span class="cx">
</span><span class="cx"> shouldThrow('req.setRequestHeader()');
</span><span class="cx"> shouldThrow('req.setRequestHeader("Foo")');
</span><del>- shouldThrow('req.status()');
- shouldThrow('req.statusText()');
</del><span class="cx">
</span><span class="cx"> req.send(null);
</span><span class="cx"> log("send()");
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequeststatusafterabortexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/status-after-abort-expected.txt (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/status-after-abort-expected.txt        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/status-after-abort-expected.txt        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -2,15 +2,15 @@
</span><span class="cx">
</span><span class="cx"> A newly created request. Response status: 0; statusText: ''; readyState: 0
</span><span class="cx"> Opening...
</span><del>-Onreadystatechange. Response status: [exception]; statusText: '[exception]'; readyState: 1
-Opened request. Response status: [exception]; statusText: '[exception]'; readyState: 1
-Sent request. Response status: [exception]; statusText: '[exception]'; readyState: 1
</del><ins>+Onreadystatechange. Response status: 0; statusText: ''; readyState: 1
+Opened request. Response status: 0; statusText: ''; readyState: 1
+Sent request. Response status: 0; statusText: ''; readyState: 1
</ins><span class="cx"> Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 2
</span><span class="cx"> Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 3
</span><span class="cx"> Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 4
</span><span class="cx"> Aborting the request...
</span><del>-After aborting the request. Response status: 200; statusText: 'OK'; readyState: 0
</del><ins>+After aborting the request. Response status: 0; statusText: ''; readyState: 0
</ins><span class="cx"> Reopening the request to check that the status is reset...
</span><del>-Onreadystatechange. Response status: [exception]; statusText: '[exception]'; readyState: 1
</del><ins>+Onreadystatechange. Response status: 0; statusText: ''; readyState: 1
</ins><span class="cx"> Done.
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestzerolengthresponseexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -8,14 +8,14 @@
</span><span class="cx"> ResponseXML serialized: n/a
</span><span class="cx"> after setting onreadystatechange: Uninitialized
</span><span class="cx"> onreadystatechange: Open
</span><del>- Exception getting status: InvalidStateError: DOM Exception 11
- Exception getting StatusText: InvalidStateError: DOM Exception 11
</del><ins>+ Status: 0
+ StatusText: ""
</ins><span class="cx"> ResponseText: ""
</span><span class="cx"> ResponseXML: null
</span><span class="cx"> ResponseXML serialized: n/a
</span><span class="cx"> after open(): Open
</span><del>- Exception getting status: InvalidStateError: DOM Exception 11
- Exception getting StatusText: InvalidStateError: DOM Exception 11
</del><ins>+ Status: 0
+ StatusText: ""
</ins><span class="cx"> ResponseText: ""
</span><span class="cx"> ResponseXML: null
</span><span class="cx"> ResponseXML serialized: n/a
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgcustomgetterthrowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dfg-custom-getter-throw-expected.txt (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-custom-getter-throw-expected.txt        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/js/dom/dfg-custom-getter-throw-expected.txt        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -3,106 +3,106 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
-PASS bar(i >= 100) is "Returned result: 0"
</del><ins>+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
+PASS bar(i >= 100) is "Returned result: "
</ins><span class="cx"> PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11"
</span><span class="cx"> PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11"
</span><span class="cx"> PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11"
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomscripttestsdfgcustomgetterthrowinlinedjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw-inlined.js (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw-inlined.js        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw-inlined.js        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -3,17 +3,18 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> function foo(x) {
</span><del>- return x.status;
</del><ins>+ return x.responseText;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function baz(x) {
</span><span class="cx"> return foo(x);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function bar(doOpen) {
</del><ins>+function bar(binary) {
</ins><span class="cx"> var x = new XMLHttpRequest();
</span><del>- if (doOpen)
- x.open("GET", "http://foo.bar.com/");
</del><ins>+ x.open("GET", "http://foo.bar.com/");
+ if (binary)
+ x.responseType = "arraybuffer";
</ins><span class="cx"> try {
</span><span class="cx"> return "Returned result: " + baz(x);
</span><span class="cx"> } catch (e) {
</span><span class="lines">@@ -25,7 +26,7 @@
</span><span class="cx"> silentTestPass = true;
</span><span class="cx">
</span><span class="cx"> for (var i = 0; i < 200; i = dfgIncrement({f:baz, i:i + 1, n:50})) {
</span><del>- shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: 0\"");
</del><ins>+ shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: \"");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomscripttestsdfgcustomgetterthrowjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw.js (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw.js        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw.js        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -3,13 +3,14 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> function foo(x) {
</span><del>- return x.status;
</del><ins>+ return x.responseText;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-function bar(doOpen) {
</del><ins>+function bar(binary) {
</ins><span class="cx"> var x = new XMLHttpRequest();
</span><del>- if (doOpen)
- x.open("GET", "http://foo.bar.com/");
</del><ins>+ x.open("GET", "http://foo.bar.com/");
+ if (binary)
+ x.responseType = "arraybuffer";
</ins><span class="cx"> try {
</span><span class="cx"> return "Returned result: " + foo(x);
</span><span class="cx"> } catch (e) {
</span><span class="lines">@@ -18,7 +19,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (var i = 0; i < 200; ++i) {
</span><del>- shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: 0\"");
</del><ins>+ shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: \"");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/Source/WebCore/ChangeLog        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2013-12-23 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><ins>+ XMLHttpRequest: status and statusText throw DOM Exception 11 when the state is UNSENT or OPENED.
+ https://bugs.webkit.org/show_bug.cgi?id=45994
+
+ Reviewed by Alexey Proskuryakov.
+
+ Merged https://chromium.googlesource.com/chromium/blink/+/23c90460de16e04c5aba7ed942fba76cb79fdb9b.
+
+ Latest XHR spec says that XHR should return 0 and an empty string when it's in UNSENT or OPENED state
+ or error flag is set: http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/#the-status-attribute
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::status):
+ (WebCore::XMLHttpRequest::statusText):
+ * xml/XMLHttpRequest.h:
+ * xml/XMLHttpRequest.idl:
+
+2013-12-23 Ryosuke Niwa <rniwa@webkit.org>
+
</ins><span class="cx"> Crash in ReplaceSelectionCommand
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=126107
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -1089,30 +1089,25 @@
</span><span class="cx"> return DOMImplementation::isXMLMIMEType(responseMIMEType().lower());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int XMLHttpRequest::status(ExceptionCode& ec) const
</del><ins>+int XMLHttpRequest::status() const
</ins><span class="cx"> {
</span><ins>+ if (m_state == UNSENT || m_state == OPENED || m_error)
+ return 0;
+
</ins><span class="cx"> if (m_response.httpStatusCode())
</span><span class="cx"> return m_response.httpStatusCode();
</span><span class="cx">
</span><del>- if (m_state == OPENED) {
- // Firefox only raises an exception in this state; we match it.
- // Note the case of local file requests, where we have no HTTP response code! Firefox never raises an exception for those, but we match HTTP case for consistency.
- ec = INVALID_STATE_ERR;
- }
-
</del><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String XMLHttpRequest::statusText(ExceptionCode& ec) const
</del><ins>+String XMLHttpRequest::statusText() const
</ins><span class="cx"> {
</span><ins>+ if (m_state == UNSENT || m_state == OPENED || m_error)
+ return String();
+
</ins><span class="cx"> if (!m_response.httpStatusText().isNull())
</span><span class="cx"> return m_response.httpStatusText();
</span><span class="cx">
</span><del>- if (m_state == OPENED) {
- // See comments in status() above.
- ec = INVALID_STATE_ERR;
- }
-
</del><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.h        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -85,8 +85,8 @@
</span><span class="cx"> virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE { return ActiveDOMObject::scriptExecutionContext(); }
</span><span class="cx">
</span><span class="cx"> const URL& url() const { return m_url; }
</span><del>- String statusText(ExceptionCode&) const;
- int status(ExceptionCode&) const;
</del><ins>+ String statusText() const;
+ int status() const;
</ins><span class="cx"> State readyState() const;
</span><span class="cx"> bool withCredentials() const { return m_includeCredentials; }
</span><span class="cx"> void setWithCredentials(bool, ExceptionCode&);
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.idl (161050 => 161051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.idl        2013-12-24 07:44:52 UTC (rev 161050)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.idl        2013-12-24 08:05:56 UTC (rev 161051)
</span><span class="lines">@@ -88,8 +88,8 @@
</span><span class="cx"> [SetterRaisesException] attribute XMLHttpRequestResponseType responseType;
</span><span class="cx"> [GetterRaisesException, CachedAttribute, CustomGetter] readonly attribute Object response;
</span><span class="cx">
</span><del>- [GetterRaisesException] readonly attribute unsigned short status;
- [GetterRaisesException] readonly attribute DOMString statusText;
</del><ins>+ readonly attribute unsigned short status;
+ readonly attribute DOMString statusText;
</ins><span class="cx">
</span><span class="cx"> // Extension
</span><span class="cx"> void overrideMimeType(DOMString override);
</span></span></pre>
</div>
</div>
</body>
</html>