Changeset 281472 in webkit
- Timestamp:
- Aug 23, 2021 2:39:37 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 12 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/location-new-window-no-crash-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/location-new-window-no-crash.html (modified) (1 diff)
-
LayoutTests/fast/loader/file-URL-with-port-number.html (modified) (1 diff)
-
LayoutTests/fast/loader/location-port.html (modified) (3 diffs)
-
LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html (modified) (1 diff)
-
LayoutTests/fast/url/navigate-non-ascii.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt (modified) (76 diffs)
-
LayoutTests/platform/ios-wk1/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt (deleted)
-
LayoutTests/platform/mac-wk1/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/Location.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r281471 r281472 1 2021-08-23 Alex Christensen <achristensen@webkit.org> 2 3 Setting window.location.href to an invalid URL should throw a TypeError 4 https://bugs.webkit.org/show_bug.cgi?id=229303 5 6 Reviewed by Chris Dumez. 7 8 * fast/dom/location-new-window-no-crash-expected.txt: 9 * fast/dom/location-new-window-no-crash.html: 10 * fast/loader/file-URL-with-port-number.html: 11 * fast/loader/location-port.html: 12 * fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt: 13 * fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html: 14 * fast/url/navigate-non-ascii.html: 15 * platform/ios-wk1/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt: Removed. 16 * platform/mac-wk1/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt: Removed. 17 1 18 2021-08-23 Ayumi Kojima <ayumi_kojima@apple.com> 2 19 -
trunk/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt
r43014 r281472 15 15 PASS testWindow.location.href = 'data:text/plain,b' is 'data:text/plain,b' 16 16 PASS testWindow.location.protocol = 'data' is 'data' 17 PASS testWindow.location.host = 'c' is 'c'18 PASS testWindow.location.hostname = 'd' is 'd'19 PASS testWindow.location.port = 'e' is 'e'20 PASS testWindow.location.pathname = 'f' is 'f'21 PASS testWindow.location.search = 'g' is 'g'17 PASS testWindow.location.host = 'c' threw exception TypeError: Invalid URL. 18 PASS testWindow.location.hostname = 'd' threw exception TypeError: Invalid URL. 19 PASS testWindow.location.port = 'e' threw exception TypeError: Invalid URL. 20 PASS testWindow.location.pathname = 'f' threw exception TypeError: Invalid URL. 21 PASS testWindow.location.search = 'g' threw exception TypeError: Invalid URL. 22 22 PASS testWindow.location.hash = 'h' is 'h' 23 23 PASS testWindow.location.assign('data:text/plain,i') is undefined -
trunk/LayoutTests/fast/dom/location-new-window-no-crash.html
r217390 r281472 31 31 shouldBe("testWindow.location.href = 'data:text/plain,b'", "'data:text/plain,b'"); 32 32 shouldBe("testWindow.location.protocol = 'data'", "'data'"); // Firefox throws an exception 33 should Be("testWindow.location.host = 'c'", "'c'"); // Firefox throws an exception34 should Be("testWindow.location.hostname = 'd'", "'d'"); // Firefox throws an exception35 should Be("testWindow.location.port = 'e'", "'e'"); // Firefox throws an exception36 should Be("testWindow.location.pathname = 'f'", "'f'"); // Firefox throws an exception37 should Be("testWindow.location.search = 'g'", "'g'");33 shouldThrow("testWindow.location.host = 'c'"); 34 shouldThrow("testWindow.location.hostname = 'd'"); 35 shouldThrow("testWindow.location.port = 'e'"); 36 shouldThrow("testWindow.location.pathname = 'f'"); 37 shouldThrow("testWindow.location.search = 'g'"); 38 38 shouldBe("testWindow.location.hash = 'h'", "'h'"); 39 39 -
trunk/LayoutTests/fast/loader/file-URL-with-port-number.html
r268479 r281472 39 39 subframe.onload = subframeLoaded; 40 40 subframe.onerror = subframeError; 41 subframe.contentWindow.location = subframeLocation; 41 try { 42 subframe.contentWindow.location = subframeLocation; 43 } catch (e) { } 42 44 setTimeout(subframeDidNotLoad, 100); 43 45 } -
trunk/LayoutTests/fast/loader/location-port.html
r207162 r281472 36 36 shouldBe('internalFrame.contentWindow.location.port == ""', true); 37 37 38 internalFrame.contentWindow.location.port = 80; 38 try { 39 internalFrame.contentWindow.location.port = 80; 40 } catch (e) { } 39 41 setTimeout(checkTest3, 300); 40 42 } … … 44 46 shouldBe('internalFrame.contentWindow.location.port == ""', true); 45 47 46 internalFrame.contentWindow.location.port = 0; 48 try { 49 internalFrame.contentWindow.location.port = 0; 50 } catch (e) { } 47 51 setTimeout(checkTest4, 300); 48 52 } … … 67 71 shouldBe('internalFrame.contentWindow.location.port == ""', true); 68 72 69 internalFrame.contentWindow.location.port = 88; 73 try { 74 internalFrame.contentWindow.location.port = 88; 75 } catch (e) { } 70 76 setTimeout(checkTest1, 300); 71 77 }; -
trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt
r267644 r281472 1 1 main frame - didFinishDocumentLoadForFrame 2 main frame - willPerformClientRedirectToURL: http://A=a%B=b3 2 main frame - didHandleOnloadEventsForFrame 4 3 main frame - didFinishLoadForFrame 5 main frame - didCancelClientRedirectForFrame6 4 Tests that we do not redirect to an invalid URL initiated by JavaScript. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a%B=b" followed by "didCancelClientRedirectForFrame". 7 5 … … 9 7 10 8 11 PASS testRunner.didCancelClientRedirect becametrue9 PASS caughtException is true 12 10 PASS successfullyParsed is true 13 11 -
trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html
r229341 r281472 12 12 <script> 13 13 description("Tests that we do not redirect to an invalid URL initiated by JavaScript. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a%B=b" followed by "didCancelClientRedirectForFrame"."); 14 var caughtException = false; 14 15 onload = function() { 15 window.location.href = "http://A=a%B=b"; 16 shouldBecomeEqual("testRunner.didCancelClientRedirect", "true", finishJSTest); 16 try { 17 window.location.href = "http://A=a%B=b"; 18 } catch (e) { 19 caughtException = true; 20 } 21 shouldBe("caughtException", "true"); 22 finishJSTest(); 17 23 } 18 24 </script> -
trunk/LayoutTests/fast/url/navigate-non-ascii.html
r263475 r281472 1 1 <script> 2 location.assign('//\u2000'); 2 try { 3 location.assign('//\u2000'); 4 } catch (e) { } 3 5 testRunner.waitUntilDone(); 4 6 testRunner.dumpAsText(); -
trunk/LayoutTests/imported/w3c/ChangeLog
r281470 r281472 1 2021-08-23 Alex Christensen <achristensen@webkit.org> 2 3 Setting window.location.href to an invalid URL should throw a TypeError 4 https://bugs.webkit.org/show_bug.cgi?id=229303 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/url/failure-expected.txt: 9 1 10 2021-08-23 Cameron McCormack <heycam@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt
r279895 r281472 5 5 PASS XHR: file://example:1/ should throw 6 6 PASS sendBeacon(): file://example:1/ should throw 7 FAIL Location's href: file://example:1/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow7 PASS Location's href: file://example:1/ should throw 8 8 PASS window.open(): file://example:1/ should throw 9 9 PASS URL's constructor's base argument: file://example:test/ should throw … … 11 11 PASS XHR: file://example:test/ should throw 12 12 PASS sendBeacon(): file://example:test/ should throw 13 FAIL Location's href: file://example:test/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow13 PASS Location's href: file://example:test/ should throw 14 14 PASS window.open(): file://example:test/ should throw 15 15 PASS URL's constructor's base argument: file://example%/ should throw … … 17 17 PASS XHR: file://example%/ should throw 18 18 PASS sendBeacon(): file://example%/ should throw 19 FAIL Location's href: file://example%/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow19 PASS Location's href: file://example%/ should throw 20 20 PASS window.open(): file://example%/ should throw 21 21 PASS URL's constructor's base argument: file://[example]/ should throw … … 23 23 PASS XHR: file://[example]/ should throw 24 24 PASS sendBeacon(): file://[example]/ should throw 25 FAIL Location's href: file://[example]/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow25 PASS Location's href: file://[example]/ should throw 26 26 PASS window.open(): file://[example]/ should throw 27 27 PASS URL's constructor's base argument: http://user:pass@/ should throw … … 29 29 PASS XHR: http://user:pass@/ should throw 30 30 PASS sendBeacon(): http://user:pass@/ should throw 31 FAIL Location's href: http://user:pass@/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow31 PASS Location's href: http://user:pass@/ should throw 32 32 PASS window.open(): http://user:pass@/ should throw 33 33 PASS URL's constructor's base argument: http://foo:-80/ should throw … … 35 35 PASS XHR: http://foo:-80/ should throw 36 36 PASS sendBeacon(): http://foo:-80/ should throw 37 FAIL Location's href: http://foo:-80/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow37 PASS Location's href: http://foo:-80/ should throw 38 38 PASS window.open(): http://foo:-80/ should throw 39 39 PASS URL's constructor's base argument: http:/:@/www.example.com should throw … … 43 43 PASS XHR: http://user@/www.example.com should throw 44 44 PASS sendBeacon(): http://user@/www.example.com should throw 45 FAIL Location's href: http://user@/www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow45 PASS Location's href: http://user@/www.example.com should throw 46 46 PASS window.open(): http://user@/www.example.com should throw 47 47 PASS URL's constructor's base argument: http:@/www.example.com should throw … … 53 53 PASS XHR: http://@/www.example.com should throw 54 54 PASS sendBeacon(): http://@/www.example.com should throw 55 FAIL Location's href: http://@/www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow55 PASS Location's href: http://@/www.example.com should throw 56 56 PASS window.open(): http://@/www.example.com should throw 57 57 PASS URL's constructor's base argument: https:@/www.example.com should throw … … 65 65 PASS XHR: http://a:b@/www.example.com should throw 66 66 PASS sendBeacon(): http://a:b@/www.example.com should throw 67 FAIL Location's href: http://a:b@/www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow67 PASS Location's href: http://a:b@/www.example.com should throw 68 68 PASS window.open(): http://a:b@/www.example.com should throw 69 69 PASS URL's constructor's base argument: http::@/www.example.com should throw … … 77 77 PASS XHR: http://@:www.example.com should throw 78 78 PASS sendBeacon(): http://@:www.example.com should throw 79 FAIL Location's href: http://@:www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow79 PASS Location's href: http://@:www.example.com should throw 80 80 PASS window.open(): http://@:www.example.com should throw 81 81 PASS URL's constructor's base argument: https://� should throw … … 83 83 PASS XHR: https://� should throw 84 84 PASS sendBeacon(): https://� should throw 85 FAIL Location's href: https://� should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow85 PASS Location's href: https://� should throw 86 86 PASS window.open(): https://� should throw 87 87 PASS URL's constructor's base argument: https://%EF%BF%BD should throw … … 89 89 PASS XHR: https://%EF%BF%BD should throw 90 90 PASS sendBeacon(): https://%EF%BF%BD should throw 91 FAIL Location's href: https://%EF%BF%BD should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow91 PASS Location's href: https://%EF%BF%BD should throw 92 92 PASS window.open(): https://%EF%BF%BD should throw 93 93 PASS URL's constructor's base argument: http://a.b.c.xn--pokxncvks should throw … … 95 95 PASS XHR: http://a.b.c.xn--pokxncvks should throw 96 96 PASS sendBeacon(): http://a.b.c.xn--pokxncvks should throw 97 FAIL Location's href: http://a.b.c.xn--pokxncvks should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow97 PASS Location's href: http://a.b.c.xn--pokxncvks should throw 98 98 PASS window.open(): http://a.b.c.xn--pokxncvks should throw 99 99 PASS URL's constructor's base argument: http://10.0.0.xn--pokxncvks should throw … … 101 101 PASS XHR: http://10.0.0.xn--pokxncvks should throw 102 102 PASS sendBeacon(): http://10.0.0.xn--pokxncvks should throw 103 FAIL Location's href: http://10.0.0.xn--pokxncvks should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow103 PASS Location's href: http://10.0.0.xn--pokxncvks should throw 104 104 PASS window.open(): http://10.0.0.xn--pokxncvks should throw 105 105 PASS URL's constructor's base argument: https://x x:12 should throw … … 107 107 PASS XHR: https://x x:12 should throw 108 108 PASS sendBeacon(): https://x x:12 should throw 109 FAIL Location's href: https://x x:12 should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow109 PASS Location's href: https://x x:12 should throw 110 110 PASS window.open(): https://x x:12 should throw 111 111 PASS URL's constructor's base argument: http://[www.google.com]/ should throw … … 113 113 PASS XHR: http://[www.google.com]/ should throw 114 114 PASS sendBeacon(): http://[www.google.com]/ should throw 115 FAIL Location's href: http://[www.google.com]/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow115 PASS Location's href: http://[www.google.com]/ should throw 116 116 PASS window.open(): http://[www.google.com]/ should throw 117 117 PASS URL's constructor's base argument: sc://\0/ should throw … … 119 119 PASS XHR: sc://\0/ should throw 120 120 PASS sendBeacon(): sc://\0/ should throw 121 FAIL Location's href: sc://\0/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow121 PASS Location's href: sc://\0/ should throw 122 122 PASS window.open(): sc://\0/ should throw 123 123 PASS URL's constructor's base argument: sc:// / should throw … … 125 125 PASS XHR: sc:// / should throw 126 126 PASS sendBeacon(): sc:// / should throw 127 FAIL Location's href: sc:// / should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow127 PASS Location's href: sc:// / should throw 128 128 PASS window.open(): sc:// / should throw 129 129 PASS URL's constructor's base argument: sc://@/ should throw … … 131 131 PASS XHR: sc://@/ should throw 132 132 PASS sendBeacon(): sc://@/ should throw 133 FAIL Location's href: sc://@/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow133 PASS Location's href: sc://@/ should throw 134 134 PASS window.open(): sc://@/ should throw 135 135 PASS URL's constructor's base argument: sc://te@s:t@/ should throw … … 137 137 PASS XHR: sc://te@s:t@/ should throw 138 138 PASS sendBeacon(): sc://te@s:t@/ should throw 139 FAIL Location's href: sc://te@s:t@/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow139 PASS Location's href: sc://te@s:t@/ should throw 140 140 PASS window.open(): sc://te@s:t@/ should throw 141 141 PASS URL's constructor's base argument: sc://:/ should throw … … 143 143 PASS XHR: sc://:/ should throw 144 144 PASS sendBeacon(): sc://:/ should throw 145 FAIL Location's href: sc://:/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow145 PASS Location's href: sc://:/ should throw 146 146 PASS window.open(): sc://:/ should throw 147 147 PASS URL's constructor's base argument: sc://:12/ should throw … … 149 149 PASS XHR: sc://:12/ should throw 150 150 PASS sendBeacon(): sc://:12/ should throw 151 FAIL Location's href: sc://:12/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow151 PASS Location's href: sc://:12/ should throw 152 152 PASS window.open(): sc://:12/ should throw 153 153 PASS URL's constructor's base argument: sc://[/ should throw … … 155 155 PASS XHR: sc://[/ should throw 156 156 PASS sendBeacon(): sc://[/ should throw 157 FAIL Location's href: sc://[/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow157 PASS Location's href: sc://[/ should throw 158 158 PASS window.open(): sc://[/ should throw 159 159 PASS URL's constructor's base argument: sc://\/ should throw … … 161 161 PASS XHR: sc://\/ should throw 162 162 PASS sendBeacon(): sc://\/ should throw 163 FAIL Location's href: sc://\/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow163 PASS Location's href: sc://\/ should throw 164 164 PASS window.open(): sc://\/ should throw 165 165 PASS URL's constructor's base argument: sc://]/ should throw … … 167 167 PASS XHR: sc://]/ should throw 168 168 PASS sendBeacon(): sc://]/ should throw 169 FAIL Location's href: sc://]/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow169 PASS Location's href: sc://]/ should throw 170 170 PASS window.open(): sc://]/ should throw 171 171 PASS URL's constructor's base argument: http://a<b should throw … … 173 173 PASS XHR: http://a<b should throw 174 174 PASS sendBeacon(): http://a<b should throw 175 FAIL Location's href: http://a<b should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow175 PASS Location's href: http://a<b should throw 176 176 PASS window.open(): http://a<b should throw 177 177 PASS URL's constructor's base argument: http://a>b should throw … … 179 179 PASS XHR: http://a>b should throw 180 180 PASS sendBeacon(): http://a>b should throw 181 FAIL Location's href: http://a>b should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow181 PASS Location's href: http://a>b should throw 182 182 PASS window.open(): http://a>b should throw 183 183 PASS URL's constructor's base argument: http://a^b should throw … … 185 185 PASS XHR: http://a^b should throw 186 186 PASS sendBeacon(): http://a^b should throw 187 FAIL Location's href: http://a^b should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow187 PASS Location's href: http://a^b should throw 188 188 PASS window.open(): http://a^b should throw 189 189 PASS URL's constructor's base argument: non-special://a<b should throw … … 191 191 PASS XHR: non-special://a<b should throw 192 192 PASS sendBeacon(): non-special://a<b should throw 193 FAIL Location's href: non-special://a<b should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow193 PASS Location's href: non-special://a<b should throw 194 194 PASS window.open(): non-special://a<b should throw 195 195 PASS URL's constructor's base argument: non-special://a>b should throw … … 197 197 PASS XHR: non-special://a>b should throw 198 198 PASS sendBeacon(): non-special://a>b should throw 199 FAIL Location's href: non-special://a>b should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow199 PASS Location's href: non-special://a>b should throw 200 200 PASS window.open(): non-special://a>b should throw 201 201 PASS URL's constructor's base argument: non-special://a^b should throw … … 203 203 PASS XHR: non-special://a^b should throw 204 204 PASS sendBeacon(): non-special://a^b should throw 205 FAIL Location's href: non-special://a^b should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow205 PASS Location's href: non-special://a^b should throw 206 206 PASS window.open(): non-special://a^b should throw 207 207 PASS URL's constructor's base argument: foo://ho\0st/ should throw … … 209 209 PASS XHR: foo://ho\0st/ should throw 210 210 PASS sendBeacon(): foo://ho\0st/ should throw 211 FAIL Location's href: foo://ho\0st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow211 PASS Location's href: foo://ho\0st/ should throw 212 212 PASS window.open(): foo://ho\0st/ should throw 213 213 PASS URL's constructor's base argument: foo://ho|st/ should throw … … 215 215 PASS XHR: foo://ho|st/ should throw 216 216 PASS sendBeacon(): foo://ho|st/ should throw 217 FAIL Location's href: foo://ho|st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow217 PASS Location's href: foo://ho|st/ should throw 218 218 PASS window.open(): foo://ho|st/ should throw 219 219 PASS URL's constructor's base argument: http://ho%00st/ should throw … … 221 221 PASS XHR: http://ho%00st/ should throw 222 222 PASS sendBeacon(): http://ho%00st/ should throw 223 FAIL Location's href: http://ho%00st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow223 PASS Location's href: http://ho%00st/ should throw 224 224 PASS window.open(): http://ho%00st/ should throw 225 225 PASS URL's constructor's base argument: http://ho%09st/ should throw … … 227 227 PASS XHR: http://ho%09st/ should throw 228 228 PASS sendBeacon(): http://ho%09st/ should throw 229 FAIL Location's href: http://ho%09st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow229 PASS Location's href: http://ho%09st/ should throw 230 230 PASS window.open(): http://ho%09st/ should throw 231 231 PASS URL's constructor's base argument: http://ho%0Ast/ should throw … … 233 233 PASS XHR: http://ho%0Ast/ should throw 234 234 PASS sendBeacon(): http://ho%0Ast/ should throw 235 FAIL Location's href: http://ho%0Ast/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow235 PASS Location's href: http://ho%0Ast/ should throw 236 236 PASS window.open(): http://ho%0Ast/ should throw 237 237 PASS URL's constructor's base argument: http://ho%0Dst/ should throw … … 239 239 PASS XHR: http://ho%0Dst/ should throw 240 240 PASS sendBeacon(): http://ho%0Dst/ should throw 241 FAIL Location's href: http://ho%0Dst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow241 PASS Location's href: http://ho%0Dst/ should throw 242 242 PASS window.open(): http://ho%0Dst/ should throw 243 243 PASS URL's constructor's base argument: http://ho%20st/ should throw … … 245 245 PASS XHR: http://ho%20st/ should throw 246 246 PASS sendBeacon(): http://ho%20st/ should throw 247 FAIL Location's href: http://ho%20st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow247 PASS Location's href: http://ho%20st/ should throw 248 248 PASS window.open(): http://ho%20st/ should throw 249 249 PASS URL's constructor's base argument: http://ho%23st/ should throw … … 251 251 PASS XHR: http://ho%23st/ should throw 252 252 PASS sendBeacon(): http://ho%23st/ should throw 253 FAIL Location's href: http://ho%23st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow253 PASS Location's href: http://ho%23st/ should throw 254 254 PASS window.open(): http://ho%23st/ should throw 255 255 PASS URL's constructor's base argument: http://ho%2Fst/ should throw … … 257 257 PASS XHR: http://ho%2Fst/ should throw 258 258 PASS sendBeacon(): http://ho%2Fst/ should throw 259 FAIL Location's href: http://ho%2Fst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow259 PASS Location's href: http://ho%2Fst/ should throw 260 260 PASS window.open(): http://ho%2Fst/ should throw 261 261 PASS URL's constructor's base argument: http://ho%3Ast/ should throw … … 263 263 PASS XHR: http://ho%3Ast/ should throw 264 264 PASS sendBeacon(): http://ho%3Ast/ should throw 265 FAIL Location's href: http://ho%3Ast/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow265 PASS Location's href: http://ho%3Ast/ should throw 266 266 PASS window.open(): http://ho%3Ast/ should throw 267 267 PASS URL's constructor's base argument: http://ho%3Cst/ should throw … … 269 269 PASS XHR: http://ho%3Cst/ should throw 270 270 PASS sendBeacon(): http://ho%3Cst/ should throw 271 FAIL Location's href: http://ho%3Cst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow271 PASS Location's href: http://ho%3Cst/ should throw 272 272 PASS window.open(): http://ho%3Cst/ should throw 273 273 PASS URL's constructor's base argument: http://ho%3Est/ should throw … … 275 275 PASS XHR: http://ho%3Est/ should throw 276 276 PASS sendBeacon(): http://ho%3Est/ should throw 277 FAIL Location's href: http://ho%3Est/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow277 PASS Location's href: http://ho%3Est/ should throw 278 278 PASS window.open(): http://ho%3Est/ should throw 279 279 PASS URL's constructor's base argument: http://ho%3Fst/ should throw … … 281 281 PASS XHR: http://ho%3Fst/ should throw 282 282 PASS sendBeacon(): http://ho%3Fst/ should throw 283 FAIL Location's href: http://ho%3Fst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow283 PASS Location's href: http://ho%3Fst/ should throw 284 284 PASS window.open(): http://ho%3Fst/ should throw 285 285 PASS URL's constructor's base argument: http://ho%40st/ should throw … … 287 287 PASS XHR: http://ho%40st/ should throw 288 288 PASS sendBeacon(): http://ho%40st/ should throw 289 FAIL Location's href: http://ho%40st/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow289 PASS Location's href: http://ho%40st/ should throw 290 290 PASS window.open(): http://ho%40st/ should throw 291 291 PASS URL's constructor's base argument: http://ho%5Bst/ should throw … … 293 293 PASS XHR: http://ho%5Bst/ should throw 294 294 PASS sendBeacon(): http://ho%5Bst/ should throw 295 FAIL Location's href: http://ho%5Bst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow295 PASS Location's href: http://ho%5Bst/ should throw 296 296 PASS window.open(): http://ho%5Bst/ should throw 297 297 PASS URL's constructor's base argument: http://ho%5Cst/ should throw … … 299 299 PASS XHR: http://ho%5Cst/ should throw 300 300 PASS sendBeacon(): http://ho%5Cst/ should throw 301 FAIL Location's href: http://ho%5Cst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow301 PASS Location's href: http://ho%5Cst/ should throw 302 302 PASS window.open(): http://ho%5Cst/ should throw 303 303 PASS URL's constructor's base argument: http://ho%5Dst/ should throw … … 305 305 PASS XHR: http://ho%5Dst/ should throw 306 306 PASS sendBeacon(): http://ho%5Dst/ should throw 307 FAIL Location's href: http://ho%5Dst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow307 PASS Location's href: http://ho%5Dst/ should throw 308 308 PASS window.open(): http://ho%5Dst/ should throw 309 309 PASS URL's constructor's base argument: http://ho%7Cst/ should throw … … 311 311 PASS XHR: http://ho%7Cst/ should throw 312 312 PASS sendBeacon(): http://ho%7Cst/ should throw 313 FAIL Location's href: http://ho%7Cst/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow313 PASS Location's href: http://ho%7Cst/ should throw 314 314 PASS window.open(): http://ho%7Cst/ should throw 315 315 PASS URL's constructor's base argument: ftp://example.com%80/ should throw … … 317 317 PASS XHR: ftp://example.com%80/ should throw 318 318 PASS sendBeacon(): ftp://example.com%80/ should throw 319 FAIL Location's href: ftp://example.com%80/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow319 PASS Location's href: ftp://example.com%80/ should throw 320 320 PASS window.open(): ftp://example.com%80/ should throw 321 321 PASS URL's constructor's base argument: ftp://example.com%A0/ should throw … … 323 323 PASS XHR: ftp://example.com%A0/ should throw 324 324 PASS sendBeacon(): ftp://example.com%A0/ should throw 325 FAIL Location's href: ftp://example.com%A0/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow325 PASS Location's href: ftp://example.com%A0/ should throw 326 326 PASS window.open(): ftp://example.com%A0/ should throw 327 327 PASS URL's constructor's base argument: https://example.com%80/ should throw … … 329 329 PASS XHR: https://example.com%80/ should throw 330 330 PASS sendBeacon(): https://example.com%80/ should throw 331 FAIL Location's href: https://example.com%80/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow331 PASS Location's href: https://example.com%80/ should throw 332 332 PASS window.open(): https://example.com%80/ should throw 333 333 PASS URL's constructor's base argument: https://example.com%A0/ should throw … … 335 335 PASS XHR: https://example.com%A0/ should throw 336 336 PASS sendBeacon(): https://example.com%A0/ should throw 337 FAIL Location's href: https://example.com%A0/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow337 PASS Location's href: https://example.com%A0/ should throw 338 338 PASS window.open(): https://example.com%A0/ should throw 339 339 PASS URL's constructor's base argument: https://0x100000000/test should throw … … 341 341 PASS XHR: https://0x100000000/test should throw 342 342 PASS sendBeacon(): https://0x100000000/test should throw 343 FAIL Location's href: https://0x100000000/test should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow343 PASS Location's href: https://0x100000000/test should throw 344 344 PASS window.open(): https://0x100000000/test should throw 345 345 PASS URL's constructor's base argument: https://256.0.0.1/test should throw … … 347 347 PASS XHR: https://256.0.0.1/test should throw 348 348 PASS sendBeacon(): https://256.0.0.1/test should throw 349 FAIL Location's href: https://256.0.0.1/test should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow349 PASS Location's href: https://256.0.0.1/test should throw 350 350 PASS window.open(): https://256.0.0.1/test should throw 351 351 PASS URL's constructor's base argument: file://%43%3A should throw … … 353 353 PASS XHR: file://%43%3A should throw 354 354 PASS sendBeacon(): file://%43%3A should throw 355 FAIL Location's href: file://%43%3A should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow355 PASS Location's href: file://%43%3A should throw 356 356 PASS window.open(): file://%43%3A should throw 357 357 PASS URL's constructor's base argument: file://%43%7C should throw … … 359 359 PASS XHR: file://%43%7C should throw 360 360 PASS sendBeacon(): file://%43%7C should throw 361 FAIL Location's href: file://%43%7C should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow361 PASS Location's href: file://%43%7C should throw 362 362 PASS window.open(): file://%43%7C should throw 363 363 PASS URL's constructor's base argument: file://%43| should throw … … 365 365 PASS XHR: file://%43| should throw 366 366 PASS sendBeacon(): file://%43| should throw 367 FAIL Location's href: file://%43| should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow367 PASS Location's href: file://%43| should throw 368 368 PASS window.open(): file://%43| should throw 369 369 PASS URL's constructor's base argument: file://C%7C should throw … … 371 371 PASS XHR: file://C%7C should throw 372 372 PASS sendBeacon(): file://C%7C should throw 373 FAIL Location's href: file://C%7C should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow373 PASS Location's href: file://C%7C should throw 374 374 PASS window.open(): file://C%7C should throw 375 375 PASS URL's constructor's base argument: file://%43%7C/ should throw … … 377 377 PASS XHR: file://%43%7C/ should throw 378 378 PASS sendBeacon(): file://%43%7C/ should throw 379 FAIL Location's href: file://%43%7C/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow379 PASS Location's href: file://%43%7C/ should throw 380 380 PASS window.open(): file://%43%7C/ should throw 381 381 PASS URL's constructor's base argument: https://%43%7C/ should throw … … 383 383 PASS XHR: https://%43%7C/ should throw 384 384 PASS sendBeacon(): https://%43%7C/ should throw 385 FAIL Location's href: https://%43%7C/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow385 PASS Location's href: https://%43%7C/ should throw 386 386 PASS window.open(): https://%43%7C/ should throw 387 387 PASS URL's constructor's base argument: asdf://%43|/ should throw … … 389 389 PASS XHR: asdf://%43|/ should throw 390 390 PASS sendBeacon(): asdf://%43|/ should throw 391 FAIL Location's href: asdf://%43|/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow391 PASS Location's href: asdf://%43|/ should throw 392 392 PASS window.open(): asdf://%43|/ should throw 393 393 PASS URL's constructor's base argument: \\\.\Y: should throw … … 399 399 PASS XHR: https://[0::0::0] should throw 400 400 PASS sendBeacon(): https://[0::0::0] should throw 401 FAIL Location's href: https://[0::0::0] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow401 PASS Location's href: https://[0::0::0] should throw 402 402 PASS window.open(): https://[0::0::0] should throw 403 403 PASS URL's constructor's base argument: https://[0:.0] should throw … … 405 405 PASS XHR: https://[0:.0] should throw 406 406 PASS sendBeacon(): https://[0:.0] should throw 407 FAIL Location's href: https://[0:.0] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow407 PASS Location's href: https://[0:.0] should throw 408 408 PASS window.open(): https://[0:.0] should throw 409 409 PASS URL's constructor's base argument: https://[0:0:] should throw … … 411 411 PASS XHR: https://[0:0:] should throw 412 412 PASS sendBeacon(): https://[0:0:] should throw 413 FAIL Location's href: https://[0:0:] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow413 PASS Location's href: https://[0:0:] should throw 414 414 PASS window.open(): https://[0:0:] should throw 415 415 PASS URL's constructor's base argument: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw … … 417 417 PASS XHR: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw 418 418 PASS sendBeacon(): https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw 419 FAIL Location's href: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow419 PASS Location's href: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw 420 420 PASS window.open(): https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw 421 421 PASS URL's constructor's base argument: https://[0:1.00.0.0.0] should throw … … 423 423 PASS XHR: https://[0:1.00.0.0.0] should throw 424 424 PASS sendBeacon(): https://[0:1.00.0.0.0] should throw 425 FAIL Location's href: https://[0:1.00.0.0.0] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow425 PASS Location's href: https://[0:1.00.0.0.0] should throw 426 426 PASS window.open(): https://[0:1.00.0.0.0] should throw 427 427 PASS URL's constructor's base argument: https://[0:1.290.0.0.0] should throw … … 429 429 PASS XHR: https://[0:1.290.0.0.0] should throw 430 430 PASS sendBeacon(): https://[0:1.290.0.0.0] should throw 431 FAIL Location's href: https://[0:1.290.0.0.0] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow431 PASS Location's href: https://[0:1.290.0.0.0] should throw 432 432 PASS window.open(): https://[0:1.290.0.0.0] should throw 433 433 PASS URL's constructor's base argument: https://[0:1.23.23] should throw … … 435 435 PASS XHR: https://[0:1.23.23] should throw 436 436 PASS sendBeacon(): https://[0:1.23.23] should throw 437 FAIL Location's href: https://[0:1.23.23] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow437 PASS Location's href: https://[0:1.23.23] should throw 438 438 PASS window.open(): https://[0:1.23.23] should throw 439 439 PASS URL's constructor's base argument: http://? should throw … … 441 441 PASS XHR: http://? should throw 442 442 PASS sendBeacon(): http://? should throw 443 FAIL Location's href: http://? should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow443 PASS Location's href: http://? should throw 444 444 PASS window.open(): http://? should throw 445 445 PASS URL's constructor's base argument: http://# should throw … … 447 447 PASS XHR: http://# should throw 448 448 PASS sendBeacon(): http://# should throw 449 FAIL Location's href: http://# should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow449 PASS Location's href: http://# should throw 450 450 PASS window.open(): http://# should throw 451 451 PASS URL's constructor's base argument: non-special://[:80/ should throw … … 453 453 PASS XHR: non-special://[:80/ should throw 454 454 PASS sendBeacon(): non-special://[:80/ should throw 455 FAIL Location's href: non-special://[:80/ should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow455 PASS Location's href: non-special://[:80/ should throw 456 456 PASS window.open(): non-special://[:80/ should throw 457 457 PASS URL's constructor's base argument: http://[::127.0.0.0.1] should throw … … 459 459 PASS XHR: http://[::127.0.0.0.1] should throw 460 460 PASS sendBeacon(): http://[::127.0.0.0.1] should throw 461 FAIL Location's href: http://[::127.0.0.0.1] should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow461 PASS Location's href: http://[::127.0.0.0.1] should throw 462 462 PASS window.open(): http://[::127.0.0.0.1] should throw 463 463 PASS URL's constructor's base argument: a should throw … … 471 471 PASS XHR: file:///p should throw 472 472 PASS sendBeacon(): file:///p should throw 473 FAIL Location's href: file:///p should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow473 PASS Location's href: file:///p should throw 474 474 PASS window.open(): file:///p should throw 475 475 PASS URL's constructor's base argument: file://%C2%AD/p should throw … … 477 477 PASS XHR: file://%C2%AD/p should throw 478 478 PASS sendBeacon(): file://%C2%AD/p should throw 479 FAIL Location's href: file://%C2%AD/p should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow479 PASS Location's href: file://%C2%AD/p should throw 480 480 PASS window.open(): file://%C2%AD/p should throw 481 481 PASS URL's constructor's base argument: file://xn--/p should throw … … 483 483 PASS XHR: file://xn--/p should throw 484 484 PASS sendBeacon(): file://xn--/p should throw 485 FAIL Location's href: file://xn--/p should throw assert_throws_js: function "() => self[0].location = test.input" did notthrow485 PASS Location's href: file://xn--/p should throw 486 486 PASS window.open(): file://xn--/p should throw 487 487 -
trunk/Source/WebCore/ChangeLog
r281470 r281472 1 2021-08-23 Alex Christensen <achristensen@webkit.org> 2 3 Setting window.location.href to an invalid URL should throw a TypeError 4 https://bugs.webkit.org/show_bug.cgi?id=229303 5 6 Reviewed by Chris Dumez. 7 8 This matches Firefox and the specification, and Chrome also throws an exception in this case. 9 10 * page/Location.cpp: 11 (WebCore::Location::setLocation): 12 1 13 2021-08-23 Cameron McCormack <heycam@apple.com> 2 14 -
trunk/Source/WebCore/page/Location.cpp
r280826 r281472 278 278 URL completedURL = firstFrame->document()->completeURL(urlString); 279 279 280 // FIXME: The specification says to throw a SyntaxError if the URL is not valid. 281 if (completedURL.isNull()) 282 return { }; 280 if (!completedURL.isValid()) 281 return Exception { TypeError, "Invalid URL"_s }; 283 282 284 283 if (!incumbentWindow.document()->canNavigate(frame, completedURL))
Note: See TracChangeset
for help on using the changeset viewer.