Changeset 165229 in webkit
- Timestamp:
- Mar 6, 2014 4:26:55 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r165226 r165229 1 2014-03-06 Mark Lam <mark.lam@apple.com> 2 3 XMLHttpRequest: status and statusText throw DOM Exception 11 when the state is UNSENT or OPENED. 4 https://bugs.webkit.org/show_bug.cgi?id=45994 5 6 Not reviewed. 7 8 Re-landing r161051 (originally by Ryosuke Niwa, reviewed by Alexey Proskuryakov) 9 since https://bugs.webkit.org/show_bug.cgi?id=126219 is no longer an issue. 10 11 * http/tests/xmlhttprequest/exceptions-expected.txt: 12 * http/tests/xmlhttprequest/exceptions.html: 13 * http/tests/xmlhttprequest/status-after-abort-expected.txt: 14 * http/tests/xmlhttprequest/zero-length-response-expected.txt: 15 * js/dom/dfg-custom-getter-throw-expected.txt: 16 * js/dom/script-tests/dfg-custom-getter-throw-inlined.js: 17 (foo): 18 (bar): 19 * js/dom/script-tests/dfg-custom-getter-throw.js: 20 (foo): 21 (bar): 22 1 23 2014-03-06 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 24 -
trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt
r161058 r165229 7 7 PASS: req.setRequestHeader() threw exception TypeError: Not enough arguments. 8 8 PASS: req.setRequestHeader("Foo") threw exception TypeError: Not enough arguments. 9 PASS: req.status() threw exception Error: InvalidStateError: DOM Exception 11.10 PASS: req.statusText() threw exception Error: InvalidStateError: DOM Exception 11.11 9 send() 12 10 PASS: req.send(null) threw exception Error: InvalidStateError: DOM Exception 11. -
trunk/LayoutTests/http/tests/xmlhttprequest/exceptions.html
r161058 r165229 65 65 shouldThrow('req.setRequestHeader()'); 66 66 shouldThrow('req.setRequestHeader("Foo")'); 67 shouldThrow('req.status()');68 shouldThrow('req.statusText()');69 67 70 68 req.send(null); -
trunk/LayoutTests/http/tests/xmlhttprequest/status-after-abort-expected.txt
r161058 r165229 3 3 A newly created request. Response status: 0; statusText: ''; readyState: 0 4 4 Opening... 5 Onreadystatechange. Response status: [exception]; statusText: '[exception]'; readyState: 16 Opened request. Response status: [exception]; statusText: '[exception]'; readyState: 17 Sent request. Response status: [exception]; statusText: '[exception]'; readyState: 15 Onreadystatechange. Response status: 0; statusText: ''; readyState: 1 6 Opened request. Response status: 0; statusText: ''; readyState: 1 7 Sent request. Response status: 0; statusText: ''; readyState: 1 8 8 Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 2 9 9 Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 3 10 10 Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 4 11 11 Aborting the request... 12 After aborting the request. Response status: 200; statusText: 'OK'; readyState: 012 After aborting the request. Response status: 0; statusText: ''; readyState: 0 13 13 Reopening the request to check that the status is reset... 14 Onreadystatechange. Response status: [exception]; statusText: '[exception]'; readyState: 114 Onreadystatechange. Response status: 0; statusText: ''; readyState: 1 15 15 Done. 16 16 -
trunk/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt
r161058 r165229 9 9 after setting onreadystatechange: Uninitialized 10 10 onreadystatechange: Open 11 Exception getting status: InvalidStateError: DOM Exception 1112 Exception getting StatusText: InvalidStateError: DOM Exception 1111 Status: 0 12 StatusText: "" 13 13 ResponseText: "" 14 14 ResponseXML: null 15 15 ResponseXML serialized: n/a 16 16 after open(): Open 17 Exception getting status: InvalidStateError: DOM Exception 1118 Exception getting StatusText: InvalidStateError: DOM Exception 1117 Status: 0 18 StatusText: "" 19 19 ResponseText: "" 20 20 ResponseXML: null -
trunk/LayoutTests/js/dom/dfg-custom-getter-throw-expected.txt
r161058 r165229 4 4 5 5 6 PASS bar(i >= 100) is "Returned result: 0"7 PASS bar(i >= 100) is "Returned result: 0"8 PASS bar(i >= 100) is "Returned result: 0"9 PASS bar(i >= 100) is "Returned result: 0"10 PASS bar(i >= 100) is "Returned result: 0"11 PASS bar(i >= 100) is "Returned result: 0"12 PASS bar(i >= 100) is "Returned result: 0"13 PASS bar(i >= 100) is "Returned result: 0"14 PASS bar(i >= 100) is "Returned result: 0"15 PASS bar(i >= 100) is "Returned result: 0"16 PASS bar(i >= 100) is "Returned result: 0"17 PASS bar(i >= 100) is "Returned result: 0"18 PASS bar(i >= 100) is "Returned result: 0"19 PASS bar(i >= 100) is "Returned result: 0"20 PASS bar(i >= 100) is "Returned result: 0"21 PASS bar(i >= 100) is "Returned result: 0"22 PASS bar(i >= 100) is "Returned result: 0"23 PASS bar(i >= 100) is "Returned result: 0"24 PASS bar(i >= 100) is "Returned result: 0"25 PASS bar(i >= 100) is "Returned result: 0"26 PASS bar(i >= 100) is "Returned result: 0"27 PASS bar(i >= 100) is "Returned result: 0"28 PASS bar(i >= 100) is "Returned result: 0"29 PASS bar(i >= 100) is "Returned result: 0"30 PASS bar(i >= 100) is "Returned result: 0"31 PASS bar(i >= 100) is "Returned result: 0"32 PASS bar(i >= 100) is "Returned result: 0"33 PASS bar(i >= 100) is "Returned result: 0"34 PASS bar(i >= 100) is "Returned result: 0"35 PASS bar(i >= 100) is "Returned result: 0"36 PASS bar(i >= 100) is "Returned result: 0"37 PASS bar(i >= 100) is "Returned result: 0"38 PASS bar(i >= 100) is "Returned result: 0"39 PASS bar(i >= 100) is "Returned result: 0"40 PASS bar(i >= 100) is "Returned result: 0"41 PASS bar(i >= 100) is "Returned result: 0"42 PASS bar(i >= 100) is "Returned result: 0"43 PASS bar(i >= 100) is "Returned result: 0"44 PASS bar(i >= 100) is "Returned result: 0"45 PASS bar(i >= 100) is "Returned result: 0"46 PASS bar(i >= 100) is "Returned result: 0"47 PASS bar(i >= 100) is "Returned result: 0"48 PASS bar(i >= 100) is "Returned result: 0"49 PASS bar(i >= 100) is "Returned result: 0"50 PASS bar(i >= 100) is "Returned result: 0"51 PASS bar(i >= 100) is "Returned result: 0"52 PASS bar(i >= 100) is "Returned result: 0"53 PASS bar(i >= 100) is "Returned result: 0"54 PASS bar(i >= 100) is "Returned result: 0"55 PASS bar(i >= 100) is "Returned result: 0"56 PASS bar(i >= 100) is "Returned result: 0"57 PASS bar(i >= 100) is "Returned result: 0"58 PASS bar(i >= 100) is "Returned result: 0"59 PASS bar(i >= 100) is "Returned result: 0"60 PASS bar(i >= 100) is "Returned result: 0"61 PASS bar(i >= 100) is "Returned result: 0"62 PASS bar(i >= 100) is "Returned result: 0"63 PASS bar(i >= 100) is "Returned result: 0"64 PASS bar(i >= 100) is "Returned result: 0"65 PASS bar(i >= 100) is "Returned result: 0"66 PASS bar(i >= 100) is "Returned result: 0"67 PASS bar(i >= 100) is "Returned result: 0"68 PASS bar(i >= 100) is "Returned result: 0"69 PASS bar(i >= 100) is "Returned result: 0"70 PASS bar(i >= 100) is "Returned result: 0"71 PASS bar(i >= 100) is "Returned result: 0"72 PASS bar(i >= 100) is "Returned result: 0"73 PASS bar(i >= 100) is "Returned result: 0"74 PASS bar(i >= 100) is "Returned result: 0"75 PASS bar(i >= 100) is "Returned result: 0"76 PASS bar(i >= 100) is "Returned result: 0"77 PASS bar(i >= 100) is "Returned result: 0"78 PASS bar(i >= 100) is "Returned result: 0"79 PASS bar(i >= 100) is "Returned result: 0"80 PASS bar(i >= 100) is "Returned result: 0"81 PASS bar(i >= 100) is "Returned result: 0"82 PASS bar(i >= 100) is "Returned result: 0"83 PASS bar(i >= 100) is "Returned result: 0"84 PASS bar(i >= 100) is "Returned result: 0"85 PASS bar(i >= 100) is "Returned result: 0"86 PASS bar(i >= 100) is "Returned result: 0"87 PASS bar(i >= 100) is "Returned result: 0"88 PASS bar(i >= 100) is "Returned result: 0"89 PASS bar(i >= 100) is "Returned result: 0"90 PASS bar(i >= 100) is "Returned result: 0"91 PASS bar(i >= 100) is "Returned result: 0"92 PASS bar(i >= 100) is "Returned result: 0"93 PASS bar(i >= 100) is "Returned result: 0"94 PASS bar(i >= 100) is "Returned result: 0"95 PASS bar(i >= 100) is "Returned result: 0"96 PASS bar(i >= 100) is "Returned result: 0"97 PASS bar(i >= 100) is "Returned result: 0"98 PASS bar(i >= 100) is "Returned result: 0"99 PASS bar(i >= 100) is "Returned result: 0"100 PASS bar(i >= 100) is "Returned result: 0"101 PASS bar(i >= 100) is "Returned result: 0"102 PASS bar(i >= 100) is "Returned result: 0"103 PASS bar(i >= 100) is "Returned result: 0"104 PASS bar(i >= 100) is "Returned result: 0"105 PASS bar(i >= 100) is "Returned result: 0"6 PASS bar(i >= 100) is "Returned result: " 7 PASS bar(i >= 100) is "Returned result: " 8 PASS bar(i >= 100) is "Returned result: " 9 PASS bar(i >= 100) is "Returned result: " 10 PASS bar(i >= 100) is "Returned result: " 11 PASS bar(i >= 100) is "Returned result: " 12 PASS bar(i >= 100) is "Returned result: " 13 PASS bar(i >= 100) is "Returned result: " 14 PASS bar(i >= 100) is "Returned result: " 15 PASS bar(i >= 100) is "Returned result: " 16 PASS bar(i >= 100) is "Returned result: " 17 PASS bar(i >= 100) is "Returned result: " 18 PASS bar(i >= 100) is "Returned result: " 19 PASS bar(i >= 100) is "Returned result: " 20 PASS bar(i >= 100) is "Returned result: " 21 PASS bar(i >= 100) is "Returned result: " 22 PASS bar(i >= 100) is "Returned result: " 23 PASS bar(i >= 100) is "Returned result: " 24 PASS bar(i >= 100) is "Returned result: " 25 PASS bar(i >= 100) is "Returned result: " 26 PASS bar(i >= 100) is "Returned result: " 27 PASS bar(i >= 100) is "Returned result: " 28 PASS bar(i >= 100) is "Returned result: " 29 PASS bar(i >= 100) is "Returned result: " 30 PASS bar(i >= 100) is "Returned result: " 31 PASS bar(i >= 100) is "Returned result: " 32 PASS bar(i >= 100) is "Returned result: " 33 PASS bar(i >= 100) is "Returned result: " 34 PASS bar(i >= 100) is "Returned result: " 35 PASS bar(i >= 100) is "Returned result: " 36 PASS bar(i >= 100) is "Returned result: " 37 PASS bar(i >= 100) is "Returned result: " 38 PASS bar(i >= 100) is "Returned result: " 39 PASS bar(i >= 100) is "Returned result: " 40 PASS bar(i >= 100) is "Returned result: " 41 PASS bar(i >= 100) is "Returned result: " 42 PASS bar(i >= 100) is "Returned result: " 43 PASS bar(i >= 100) is "Returned result: " 44 PASS bar(i >= 100) is "Returned result: " 45 PASS bar(i >= 100) is "Returned result: " 46 PASS bar(i >= 100) is "Returned result: " 47 PASS bar(i >= 100) is "Returned result: " 48 PASS bar(i >= 100) is "Returned result: " 49 PASS bar(i >= 100) is "Returned result: " 50 PASS bar(i >= 100) is "Returned result: " 51 PASS bar(i >= 100) is "Returned result: " 52 PASS bar(i >= 100) is "Returned result: " 53 PASS bar(i >= 100) is "Returned result: " 54 PASS bar(i >= 100) is "Returned result: " 55 PASS bar(i >= 100) is "Returned result: " 56 PASS bar(i >= 100) is "Returned result: " 57 PASS bar(i >= 100) is "Returned result: " 58 PASS bar(i >= 100) is "Returned result: " 59 PASS bar(i >= 100) is "Returned result: " 60 PASS bar(i >= 100) is "Returned result: " 61 PASS bar(i >= 100) is "Returned result: " 62 PASS bar(i >= 100) is "Returned result: " 63 PASS bar(i >= 100) is "Returned result: " 64 PASS bar(i >= 100) is "Returned result: " 65 PASS bar(i >= 100) is "Returned result: " 66 PASS bar(i >= 100) is "Returned result: " 67 PASS bar(i >= 100) is "Returned result: " 68 PASS bar(i >= 100) is "Returned result: " 69 PASS bar(i >= 100) is "Returned result: " 70 PASS bar(i >= 100) is "Returned result: " 71 PASS bar(i >= 100) is "Returned result: " 72 PASS bar(i >= 100) is "Returned result: " 73 PASS bar(i >= 100) is "Returned result: " 74 PASS bar(i >= 100) is "Returned result: " 75 PASS bar(i >= 100) is "Returned result: " 76 PASS bar(i >= 100) is "Returned result: " 77 PASS bar(i >= 100) is "Returned result: " 78 PASS bar(i >= 100) is "Returned result: " 79 PASS bar(i >= 100) is "Returned result: " 80 PASS bar(i >= 100) is "Returned result: " 81 PASS bar(i >= 100) is "Returned result: " 82 PASS bar(i >= 100) is "Returned result: " 83 PASS bar(i >= 100) is "Returned result: " 84 PASS bar(i >= 100) is "Returned result: " 85 PASS bar(i >= 100) is "Returned result: " 86 PASS bar(i >= 100) is "Returned result: " 87 PASS bar(i >= 100) is "Returned result: " 88 PASS bar(i >= 100) is "Returned result: " 89 PASS bar(i >= 100) is "Returned result: " 90 PASS bar(i >= 100) is "Returned result: " 91 PASS bar(i >= 100) is "Returned result: " 92 PASS bar(i >= 100) is "Returned result: " 93 PASS bar(i >= 100) is "Returned result: " 94 PASS bar(i >= 100) is "Returned result: " 95 PASS bar(i >= 100) is "Returned result: " 96 PASS bar(i >= 100) is "Returned result: " 97 PASS bar(i >= 100) is "Returned result: " 98 PASS bar(i >= 100) is "Returned result: " 99 PASS bar(i >= 100) is "Returned result: " 100 PASS bar(i >= 100) is "Returned result: " 101 PASS bar(i >= 100) is "Returned result: " 102 PASS bar(i >= 100) is "Returned result: " 103 PASS bar(i >= 100) is "Returned result: " 104 PASS bar(i >= 100) is "Returned result: " 105 PASS bar(i >= 100) is "Returned result: " 106 106 PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11" 107 107 PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11" -
trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw-inlined.js
r161058 r165229 4 4 5 5 function foo(x) { 6 return x. status;6 return x.responseText; 7 7 } 8 8 … … 11 11 } 12 12 13 function bar( doOpen) {13 function bar(binary) { 14 14 var x = new XMLHttpRequest(); 15 if (doOpen) 16 x.open("GET", "http://foo.bar.com/"); 15 x.open("GET", "http://foo.bar.com/"); 16 if (binary) 17 x.responseType = "arraybuffer"; 17 18 try { 18 19 return "Returned result: " + baz(x); … … 26 27 27 28 for (var i = 0; i < 200; i = dfgIncrement({f:baz, i:i + 1, n:50})) { 28 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: 0\"");29 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: \""); 29 30 } 30 31 -
trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw.js
r161058 r165229 4 4 5 5 function foo(x) { 6 return x. status;6 return x.responseText; 7 7 } 8 8 9 function bar( doOpen) {9 function bar(binary) { 10 10 var x = new XMLHttpRequest(); 11 if (doOpen) 12 x.open("GET", "http://foo.bar.com/"); 11 x.open("GET", "http://foo.bar.com/"); 12 if (binary) 13 x.responseType = "arraybuffer"; 13 14 try { 14 15 return "Returned result: " + foo(x); … … 19 20 20 21 for (var i = 0; i < 200; ++i) { 21 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: 0\"");22 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: \""); 22 23 } 23 24 -
trunk/Source/WebCore/ChangeLog
r165227 r165229 1 2014-03-06 Mark Lam <mark.lam@apple.com> 2 3 XMLHttpRequest: status and statusText throw DOM Exception 11 when the state is UNSENT or OPENED. 4 https://bugs.webkit.org/show_bug.cgi?id=45994 5 6 Not reviewed. 7 8 Re-landing r161051 (originally by Ryosuke Niwa, reviewed by Alexey Proskuryakov) 9 since https://bugs.webkit.org/show_bug.cgi?id=126219 is no longer an issue. 10 11 * xml/XMLHttpRequest.cpp: 12 (WebCore::XMLHttpRequest::status): 13 (WebCore::XMLHttpRequest::statusText): 14 * xml/XMLHttpRequest.h: 15 * xml/XMLHttpRequest.idl: 16 1 17 2014-03-06 Brent Fulgham <bfulgham@apple.com> 2 18 -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r163915 r165229 1060 1060 } 1061 1061 1062 int XMLHttpRequest::status(ExceptionCode& ec) const 1063 { 1062 int XMLHttpRequest::status() const 1063 { 1064 if (m_state == UNSENT || m_state == OPENED || m_error) 1065 return 0; 1066 1064 1067 if (m_response.httpStatusCode()) 1065 1068 return m_response.httpStatusCode(); 1066 1069 1067 if (m_state == OPENED) {1068 // Firefox only raises an exception in this state; we match it.1069 // 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.1070 ec = INVALID_STATE_ERR;1071 }1072 1073 1070 return 0; 1074 1071 } 1075 1072 1076 String XMLHttpRequest::statusText(ExceptionCode& ec) const 1077 { 1073 String XMLHttpRequest::statusText() const 1074 { 1075 if (m_state == UNSENT || m_state == OPENED || m_error) 1076 return String(); 1077 1078 1078 if (!m_response.httpStatusText().isNull()) 1079 1079 return m_response.httpStatusText(); 1080 1081 if (m_state == OPENED) {1082 // See comments in status() above.1083 ec = INVALID_STATE_ERR;1084 }1085 1080 1086 1081 return String(); -
trunk/Source/WebCore/xml/XMLHttpRequest.h
r163022 r165229 86 86 87 87 const URL& url() const { return m_url; } 88 String statusText( ExceptionCode&) const;89 int status( ExceptionCode&) const;88 String statusText() const; 89 int status() const; 90 90 State readyState() const; 91 91 bool withCredentials() const { return m_includeCredentials; } -
trunk/Source/WebCore/xml/XMLHttpRequest.idl
r163022 r165229 89 89 [GetterRaisesException, CachedAttribute, CustomGetter] readonly attribute Object response; 90 90 91 [GetterRaisesException]readonly attribute unsigned short status;92 [GetterRaisesException]readonly attribute DOMString statusText;91 readonly attribute unsigned short status; 92 readonly attribute DOMString statusText; 93 93 94 94 // Extension
Note: See TracChangeset
for help on using the changeset viewer.