Diff
Modified: trunk/LayoutTests/ChangeLog (281471 => 281472)
--- trunk/LayoutTests/ChangeLog 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/ChangeLog 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,3 +1,20 @@
+2021-08-23 Alex Christensen <[email protected]>
+
+ Setting window.location.href to an invalid URL should throw a TypeError
+ https://bugs.webkit.org/show_bug.cgi?id=229303
+
+ Reviewed by Chris Dumez.
+
+ * fast/dom/location-new-window-no-crash-expected.txt:
+ * fast/dom/location-new-window-no-crash.html:
+ * fast/loader/file-URL-with-port-number.html:
+ * fast/loader/location-port.html:
+ * fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt:
+ * fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed.html:
+ * fast/url/navigate-non-ascii.html:
+ * platform/ios-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt: Removed.
+ * platform/mac-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt: Removed.
+
2021-08-23 Ayumi Kojima <[email protected]>
[ BigSur EWS ] http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html is flaky crash.
Modified: trunk/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt (281471 => 281472)
--- trunk/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt 2021-08-23 21:39:37 UTC (rev 281472)
@@ -14,11 +14,11 @@
PASS testWindow.location.hash is ''
PASS testWindow.location.href = '' is 'data:text/plain,b'
PASS testWindow.location.protocol = 'data' is 'data'
-PASS testWindow.location.host = 'c' is 'c'
-PASS testWindow.location.hostname = 'd' is 'd'
-PASS testWindow.location.port = 'e' is 'e'
-PASS testWindow.location.pathname = 'f' is 'f'
-PASS testWindow.location.search = 'g' is 'g'
+PASS testWindow.location.host = 'c' threw exception TypeError: Invalid URL.
+PASS testWindow.location.hostname = 'd' threw exception TypeError: Invalid URL.
+PASS testWindow.location.port = 'e' threw exception TypeError: Invalid URL.
+PASS testWindow.location.pathname = 'f' threw exception TypeError: Invalid URL.
+PASS testWindow.location.search = 'g' threw exception TypeError: Invalid URL.
PASS testWindow.location.hash = 'h' is 'h'
PASS testWindow.location.assign('data:text/plain,i') is undefined
PASS testWindow.location.replace('data:text/plain,j') is undefined
Modified: trunk/LayoutTests/fast/dom/location-new-window-no-crash.html (281471 => 281472)
--- trunk/LayoutTests/fast/dom/location-new-window-no-crash.html 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/dom/location-new-window-no-crash.html 2021-08-23 21:39:37 UTC (rev 281472)
@@ -30,11 +30,11 @@
shouldBe("testWindow.location.href = ''", "'data:text/plain,b'");
shouldBe("testWindow.location.protocol = 'data'", "'data'"); // Firefox throws an exception
-shouldBe("testWindow.location.host = 'c'", "'c'"); // Firefox throws an exception
-shouldBe("testWindow.location.hostname = 'd'", "'d'"); // Firefox throws an exception
-shouldBe("testWindow.location.port = 'e'", "'e'"); // Firefox throws an exception
-shouldBe("testWindow.location.pathname = 'f'", "'f'"); // Firefox throws an exception
-shouldBe("testWindow.location.search = 'g'", "'g'");
+shouldThrow("testWindow.location.host = 'c'");
+shouldThrow("testWindow.location.hostname = 'd'");
+shouldThrow("testWindow.location.port = 'e'");
+shouldThrow("testWindow.location.pathname = 'f'");
+shouldThrow("testWindow.location.search = 'g'");
shouldBe("testWindow.location.hash = 'h'", "'h'");
shouldBe("testWindow.location.assign('data:text/plain,i')", "undefined");
Modified: trunk/LayoutTests/fast/loader/file-URL-with-port-number.html (281471 => 281472)
--- trunk/LayoutTests/fast/loader/file-URL-with-port-number.html 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/loader/file-URL-with-port-number.html 2021-08-23 21:39:37 UTC (rev 281472)
@@ -38,7 +38,9 @@
var subframe = document.getElementById("subframe");
subframe._onload_ = subframeLoaded;
subframe._onerror_ = subframeError;
- subframe.contentWindow.location = subframeLocation;
+ try {
+ subframe.contentWindow.location = subframeLocation;
+ } catch (e) { }
setTimeout(subframeDidNotLoad, 100);
}
Modified: trunk/LayoutTests/fast/loader/location-port.html (281471 => 281472)
--- trunk/LayoutTests/fast/loader/location-port.html 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/loader/location-port.html 2021-08-23 21:39:37 UTC (rev 281472)
@@ -35,7 +35,9 @@
var internalFrame = document.getElementById ('internal');
shouldBe('internalFrame.contentWindow.location.port == ""', true);
- internalFrame.contentWindow.location.port = 80;
+ try {
+ internalFrame.contentWindow.location.port = 80;
+ } catch (e) { }
setTimeout(checkTest3, 300);
}
@@ -43,7 +45,9 @@
var internalFrame = document.getElementById ('internal');
shouldBe('internalFrame.contentWindow.location.port == ""', true);
- internalFrame.contentWindow.location.port = 0;
+ try {
+ internalFrame.contentWindow.location.port = 0;
+ } catch (e) { }
setTimeout(checkTest4, 300);
}
@@ -66,7 +70,9 @@
var internalFrame = document.getElementById ('internal');
shouldBe('internalFrame.contentWindow.location.port == ""', true);
- internalFrame.contentWindow.location.port = 88;
+ try {
+ internalFrame.contentWindow.location.port = 88;
+ } catch (e) { }
setTimeout(checkTest1, 300);
};
</script>
Modified: trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt (281471 => 281472)
--- trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,14 +1,12 @@
main frame - didFinishDocumentLoadForFrame
-main frame - willPerformClientRedirectToURL: http://A=a%B=b
main frame - didHandleOnloadEventsForFrame
main frame - didFinishLoadForFrame
-main frame - didCancelClientRedirectForFrame
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".
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS testRunner.didCancelClientRedirect became true
+PASS caughtException is true
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed.html (281471 => 281472)
--- trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed.html 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed.html 2021-08-23 21:39:37 UTC (rev 281472)
@@ -11,9 +11,15 @@
<body>
<script>
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".");
+var caughtException = false;
_onload_ = function() {
- window.location.href = ""
- shouldBecomeEqual("testRunner.didCancelClientRedirect", "true", finishJSTest);
+ try {
+ window.location.href = ""
+ } catch (e) {
+ caughtException = true;
+ }
+ shouldBe("caughtException", "true");
+ finishJSTest();
}
</script>
</body>
Modified: trunk/LayoutTests/fast/url/navigate-non-ascii.html (281471 => 281472)
--- trunk/LayoutTests/fast/url/navigate-non-ascii.html 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/fast/url/navigate-non-ascii.html 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,5 +1,7 @@
<script>
-location.assign('//\u2000');
+try {
+ location.assign('//\u2000');
+} catch (e) { }
testRunner.waitUntilDone();
testRunner.dumpAsText();
setTimeout(function() {
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (281471 => 281472)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,3 +1,12 @@
+2021-08-23 Alex Christensen <[email protected]>
+
+ Setting window.location.href to an invalid URL should throw a TypeError
+ https://bugs.webkit.org/show_bug.cgi?id=229303
+
+ Reviewed by Chris Dumez.
+
+ * web-platform-tests/url/failure-expected.txt:
+
2021-08-23 Cameron McCormack <[email protected]>
Preserve color space when getting current color in DisplayListDrawGlyphsRecorder.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt (281471 => 281472)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt 2021-08-23 21:39:37 UTC (rev 281472)
@@ -4,37 +4,37 @@
PASS URL's href: file://example:1/ should throw
PASS XHR: file://example:1/ should throw
PASS sendBeacon(): file://example:1/ should throw
-FAIL Location's href: file://example:1/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://example:1/ should throw
PASS window.open(): file://example:1/ should throw
PASS URL's constructor's base argument: file://example:test/ should throw
PASS URL's href: file://example:test/ should throw
PASS XHR: file://example:test/ should throw
PASS sendBeacon(): file://example:test/ should throw
-FAIL Location's href: file://example:test/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://example:test/ should throw
PASS window.open(): file://example:test/ should throw
PASS URL's constructor's base argument: file://example%/ should throw
PASS URL's href: file://example%/ should throw
PASS XHR: file://example%/ should throw
PASS sendBeacon(): file://example%/ should throw
-FAIL Location's href: file://example%/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://example%/ should throw
PASS window.open(): file://example%/ should throw
PASS URL's constructor's base argument: file://[example]/ should throw
PASS URL's href: file://[example]/ should throw
PASS XHR: file://[example]/ should throw
PASS sendBeacon(): file://[example]/ should throw
-FAIL Location's href: file://[example]/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://[example]/ should throw
PASS window.open(): file://[example]/ should throw
PASS URL's constructor's base argument: http://user:pass@/ should throw
PASS URL's href: http://user:pass@/ should throw
PASS XHR: http://user:pass@/ should throw
PASS sendBeacon(): http://user:pass@/ should throw
-FAIL Location's href: http://user:pass@/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://user:pass@/ should throw
PASS window.open(): http://user:pass@/ should throw
PASS URL's constructor's base argument: http://foo:-80/ should throw
PASS URL's href: http://foo:-80/ should throw
PASS XHR: http://foo:-80/ should throw
PASS sendBeacon(): http://foo:-80/ should throw
-FAIL Location's href: http://foo:-80/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://foo:-80/ should throw
PASS window.open(): http://foo:-80/ should throw
PASS URL's constructor's base argument: http:/:@/www.example.com should throw
PASS URL's href: http:/:@/www.example.com should throw
@@ -42,7 +42,7 @@
PASS URL's href: http://user@/www.example.com should throw
PASS XHR: http://user@/www.example.com should throw
PASS sendBeacon(): http://user@/www.example.com should throw
-FAIL Location's href: http://user@/www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://user@/www.example.com should throw
PASS window.open(): http://user@/www.example.com should throw
PASS URL's constructor's base argument: http:@/www.example.com should throw
PASS URL's href: http:@/www.example.com should throw
@@ -52,7 +52,7 @@
PASS URL's href: http://@/www.example.com should throw
PASS XHR: http://@/www.example.com should throw
PASS sendBeacon(): http://@/www.example.com should throw
-FAIL Location's href: http://@/www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://@/www.example.com should throw
PASS window.open(): http://@/www.example.com should throw
PASS URL's constructor's base argument: https:@/www.example.com should throw
PASS URL's href: https:@/www.example.com should throw
@@ -64,7 +64,7 @@
PASS URL's href: http://a:b@/www.example.com should throw
PASS XHR: http://a:b@/www.example.com should throw
PASS sendBeacon(): http://a:b@/www.example.com should throw
-FAIL Location's href: http://a:b@/www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://a:b@/www.example.com should throw
PASS window.open(): http://a:b@/www.example.com should throw
PASS URL's constructor's base argument: http::@/www.example.com should throw
PASS URL's href: http::@/www.example.com should throw
@@ -76,319 +76,319 @@
PASS URL's href: http://@:www.example.com should throw
PASS XHR: http://@:www.example.com should throw
PASS sendBeacon(): http://@:www.example.com should throw
-FAIL Location's href: http://@:www.example.com should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://@:www.example.com should throw
PASS window.open(): http://@:www.example.com should throw
PASS URL's constructor's base argument: https://� should throw
PASS URL's href: https://� should throw
PASS XHR: https://� should throw
PASS sendBeacon(): https://� should throw
-FAIL Location's href: https://� should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://� should throw
PASS window.open(): https://� should throw
PASS URL's constructor's base argument: https://%EF%BF%BD should throw
PASS URL's href: https://%EF%BF%BD should throw
PASS XHR: https://%EF%BF%BD should throw
PASS sendBeacon(): https://%EF%BF%BD should throw
-FAIL Location's href: https://%EF%BF%BD should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://%EF%BF%BD should throw
PASS window.open(): https://%EF%BF%BD should throw
PASS URL's constructor's base argument: http://a.b.c.xn--pokxncvks should throw
PASS URL's href: http://a.b.c.xn--pokxncvks should throw
PASS XHR: http://a.b.c.xn--pokxncvks should throw
PASS sendBeacon(): http://a.b.c.xn--pokxncvks should throw
-FAIL Location's href: http://a.b.c.xn--pokxncvks should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://a.b.c.xn--pokxncvks should throw
PASS window.open(): http://a.b.c.xn--pokxncvks should throw
PASS URL's constructor's base argument: http://10.0.0.xn--pokxncvks should throw
PASS URL's href: http://10.0.0.xn--pokxncvks should throw
PASS XHR: http://10.0.0.xn--pokxncvks should throw
PASS sendBeacon(): http://10.0.0.xn--pokxncvks should throw
-FAIL Location's href: http://10.0.0.xn--pokxncvks should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://10.0.0.xn--pokxncvks should throw
PASS window.open(): http://10.0.0.xn--pokxncvks should throw
PASS URL's constructor's base argument: https://x x:12 should throw
PASS URL's href: https://x x:12 should throw
PASS XHR: https://x x:12 should throw
PASS sendBeacon(): https://x x:12 should throw
-FAIL Location's href: https://x x:12 should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://x x:12 should throw
PASS window.open(): https://x x:12 should throw
PASS URL's constructor's base argument: http://[www.google.com]/ should throw
PASS URL's href: http://[www.google.com]/ should throw
PASS XHR: http://[www.google.com]/ should throw
PASS sendBeacon(): http://[www.google.com]/ should throw
-FAIL Location's href: http://[www.google.com]/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://[www.google.com]/ should throw
PASS window.open(): http://[www.google.com]/ should throw
PASS URL's constructor's base argument: sc://\0/ should throw
PASS URL's href: sc://\0/ should throw
PASS XHR: sc://\0/ should throw
PASS sendBeacon(): sc://\0/ should throw
-FAIL Location's href: sc://\0/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://\0/ should throw
PASS window.open(): sc://\0/ should throw
PASS URL's constructor's base argument: sc:// / should throw
PASS URL's href: sc:// / should throw
PASS XHR: sc:// / should throw
PASS sendBeacon(): sc:// / should throw
-FAIL Location's href: sc:// / should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc:// / should throw
PASS window.open(): sc:// / should throw
PASS URL's constructor's base argument: sc://@/ should throw
PASS URL's href: sc://@/ should throw
PASS XHR: sc://@/ should throw
PASS sendBeacon(): sc://@/ should throw
-FAIL Location's href: sc://@/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://@/ should throw
PASS window.open(): sc://@/ should throw
PASS URL's constructor's base argument: sc://te@s:t@/ should throw
PASS URL's href: sc://te@s:t@/ should throw
PASS XHR: sc://te@s:t@/ should throw
PASS sendBeacon(): sc://te@s:t@/ should throw
-FAIL Location's href: sc://te@s:t@/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://te@s:t@/ should throw
PASS window.open(): sc://te@s:t@/ should throw
PASS URL's constructor's base argument: sc://:/ should throw
PASS URL's href: sc://:/ should throw
PASS XHR: sc://:/ should throw
PASS sendBeacon(): sc://:/ should throw
-FAIL Location's href: sc://:/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://:/ should throw
PASS window.open(): sc://:/ should throw
PASS URL's constructor's base argument: sc://:12/ should throw
PASS URL's href: sc://:12/ should throw
PASS XHR: sc://:12/ should throw
PASS sendBeacon(): sc://:12/ should throw
-FAIL Location's href: sc://:12/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://:12/ should throw
PASS window.open(): sc://:12/ should throw
PASS URL's constructor's base argument: sc://[/ should throw
PASS URL's href: sc://[/ should throw
PASS XHR: sc://[/ should throw
PASS sendBeacon(): sc://[/ should throw
-FAIL Location's href: sc://[/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://[/ should throw
PASS window.open(): sc://[/ should throw
PASS URL's constructor's base argument: sc://\/ should throw
PASS URL's href: sc://\/ should throw
PASS XHR: sc://\/ should throw
PASS sendBeacon(): sc://\/ should throw
-FAIL Location's href: sc://\/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://\/ should throw
PASS window.open(): sc://\/ should throw
PASS URL's constructor's base argument: sc://]/ should throw
PASS URL's href: sc://]/ should throw
PASS XHR: sc://]/ should throw
PASS sendBeacon(): sc://]/ should throw
-FAIL Location's href: sc://]/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: sc://]/ should throw
PASS window.open(): sc://]/ should throw
PASS URL's constructor's base argument: http://a<b should throw
PASS URL's href: http://a<b should throw
PASS XHR: http://a<b should throw
PASS sendBeacon(): http://a<b should throw
-FAIL Location's href: http://a<b should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://a<b should throw
PASS window.open(): http://a<b should throw
PASS URL's constructor's base argument: http://a>b should throw
PASS URL's href: http://a>b should throw
PASS XHR: http://a>b should throw
PASS sendBeacon(): http://a>b should throw
-FAIL Location's href: http://a>b should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://a>b should throw
PASS window.open(): http://a>b should throw
PASS URL's constructor's base argument: http://a^b should throw
PASS URL's href: http://a^b should throw
PASS XHR: http://a^b should throw
PASS sendBeacon(): http://a^b should throw
-FAIL Location's href: http://a^b should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://a^b should throw
PASS window.open(): http://a^b should throw
PASS URL's constructor's base argument: non-special://a<b should throw
PASS URL's href: non-special://a<b should throw
PASS XHR: non-special://a<b should throw
PASS sendBeacon(): non-special://a<b should throw
-FAIL Location's href: non-special://a<b should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: non-special://a<b should throw
PASS window.open(): non-special://a<b should throw
PASS URL's constructor's base argument: non-special://a>b should throw
PASS URL's href: non-special://a>b should throw
PASS XHR: non-special://a>b should throw
PASS sendBeacon(): non-special://a>b should throw
-FAIL Location's href: non-special://a>b should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: non-special://a>b should throw
PASS window.open(): non-special://a>b should throw
PASS URL's constructor's base argument: non-special://a^b should throw
PASS URL's href: non-special://a^b should throw
PASS XHR: non-special://a^b should throw
PASS sendBeacon(): non-special://a^b should throw
-FAIL Location's href: non-special://a^b should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: non-special://a^b should throw
PASS window.open(): non-special://a^b should throw
PASS URL's constructor's base argument: foo://ho\0st/ should throw
PASS URL's href: foo://ho\0st/ should throw
PASS XHR: foo://ho\0st/ should throw
PASS sendBeacon(): foo://ho\0st/ should throw
-FAIL Location's href: foo://ho\0st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: foo://ho\0st/ should throw
PASS window.open(): foo://ho\0st/ should throw
PASS URL's constructor's base argument: foo://ho|st/ should throw
PASS URL's href: foo://ho|st/ should throw
PASS XHR: foo://ho|st/ should throw
PASS sendBeacon(): foo://ho|st/ should throw
-FAIL Location's href: foo://ho|st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: foo://ho|st/ should throw
PASS window.open(): foo://ho|st/ should throw
PASS URL's constructor's base argument: http://ho%00st/ should throw
PASS URL's href: http://ho%00st/ should throw
PASS XHR: http://ho%00st/ should throw
PASS sendBeacon(): http://ho%00st/ should throw
-FAIL Location's href: http://ho%00st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%00st/ should throw
PASS window.open(): http://ho%00st/ should throw
PASS URL's constructor's base argument: http://ho%09st/ should throw
PASS URL's href: http://ho%09st/ should throw
PASS XHR: http://ho%09st/ should throw
PASS sendBeacon(): http://ho%09st/ should throw
-FAIL Location's href: http://ho%09st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%09st/ should throw
PASS window.open(): http://ho%09st/ should throw
PASS URL's constructor's base argument: http://ho%0Ast/ should throw
PASS URL's href: http://ho%0Ast/ should throw
PASS XHR: http://ho%0Ast/ should throw
PASS sendBeacon(): http://ho%0Ast/ should throw
-FAIL Location's href: http://ho%0Ast/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%0Ast/ should throw
PASS window.open(): http://ho%0Ast/ should throw
PASS URL's constructor's base argument: http://ho%0Dst/ should throw
PASS URL's href: http://ho%0Dst/ should throw
PASS XHR: http://ho%0Dst/ should throw
PASS sendBeacon(): http://ho%0Dst/ should throw
-FAIL Location's href: http://ho%0Dst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%0Dst/ should throw
PASS window.open(): http://ho%0Dst/ should throw
PASS URL's constructor's base argument: http://ho%20st/ should throw
PASS URL's href: http://ho%20st/ should throw
PASS XHR: http://ho%20st/ should throw
PASS sendBeacon(): http://ho%20st/ should throw
-FAIL Location's href: http://ho%20st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%20st/ should throw
PASS window.open(): http://ho%20st/ should throw
PASS URL's constructor's base argument: http://ho%23st/ should throw
PASS URL's href: http://ho%23st/ should throw
PASS XHR: http://ho%23st/ should throw
PASS sendBeacon(): http://ho%23st/ should throw
-FAIL Location's href: http://ho%23st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%23st/ should throw
PASS window.open(): http://ho%23st/ should throw
PASS URL's constructor's base argument: http://ho%2Fst/ should throw
PASS URL's href: http://ho%2Fst/ should throw
PASS XHR: http://ho%2Fst/ should throw
PASS sendBeacon(): http://ho%2Fst/ should throw
-FAIL Location's href: http://ho%2Fst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%2Fst/ should throw
PASS window.open(): http://ho%2Fst/ should throw
PASS URL's constructor's base argument: http://ho%3Ast/ should throw
PASS URL's href: http://ho%3Ast/ should throw
PASS XHR: http://ho%3Ast/ should throw
PASS sendBeacon(): http://ho%3Ast/ should throw
-FAIL Location's href: http://ho%3Ast/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%3Ast/ should throw
PASS window.open(): http://ho%3Ast/ should throw
PASS URL's constructor's base argument: http://ho%3Cst/ should throw
PASS URL's href: http://ho%3Cst/ should throw
PASS XHR: http://ho%3Cst/ should throw
PASS sendBeacon(): http://ho%3Cst/ should throw
-FAIL Location's href: http://ho%3Cst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%3Cst/ should throw
PASS window.open(): http://ho%3Cst/ should throw
PASS URL's constructor's base argument: http://ho%3Est/ should throw
PASS URL's href: http://ho%3Est/ should throw
PASS XHR: http://ho%3Est/ should throw
PASS sendBeacon(): http://ho%3Est/ should throw
-FAIL Location's href: http://ho%3Est/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%3Est/ should throw
PASS window.open(): http://ho%3Est/ should throw
PASS URL's constructor's base argument: http://ho%3Fst/ should throw
PASS URL's href: http://ho%3Fst/ should throw
PASS XHR: http://ho%3Fst/ should throw
PASS sendBeacon(): http://ho%3Fst/ should throw
-FAIL Location's href: http://ho%3Fst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%3Fst/ should throw
PASS window.open(): http://ho%3Fst/ should throw
PASS URL's constructor's base argument: http://ho%40st/ should throw
PASS URL's href: http://ho%40st/ should throw
PASS XHR: http://ho%40st/ should throw
PASS sendBeacon(): http://ho%40st/ should throw
-FAIL Location's href: http://ho%40st/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%40st/ should throw
PASS window.open(): http://ho%40st/ should throw
PASS URL's constructor's base argument: http://ho%5Bst/ should throw
PASS URL's href: http://ho%5Bst/ should throw
PASS XHR: http://ho%5Bst/ should throw
PASS sendBeacon(): http://ho%5Bst/ should throw
-FAIL Location's href: http://ho%5Bst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%5Bst/ should throw
PASS window.open(): http://ho%5Bst/ should throw
PASS URL's constructor's base argument: http://ho%5Cst/ should throw
PASS URL's href: http://ho%5Cst/ should throw
PASS XHR: http://ho%5Cst/ should throw
PASS sendBeacon(): http://ho%5Cst/ should throw
-FAIL Location's href: http://ho%5Cst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%5Cst/ should throw
PASS window.open(): http://ho%5Cst/ should throw
PASS URL's constructor's base argument: http://ho%5Dst/ should throw
PASS URL's href: http://ho%5Dst/ should throw
PASS XHR: http://ho%5Dst/ should throw
PASS sendBeacon(): http://ho%5Dst/ should throw
-FAIL Location's href: http://ho%5Dst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%5Dst/ should throw
PASS window.open(): http://ho%5Dst/ should throw
PASS URL's constructor's base argument: http://ho%7Cst/ should throw
PASS URL's href: http://ho%7Cst/ should throw
PASS XHR: http://ho%7Cst/ should throw
PASS sendBeacon(): http://ho%7Cst/ should throw
-FAIL Location's href: http://ho%7Cst/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://ho%7Cst/ should throw
PASS window.open(): http://ho%7Cst/ should throw
PASS URL's constructor's base argument: ftp://example.com%80/ should throw
PASS URL's href: ftp://example.com%80/ should throw
PASS XHR: ftp://example.com%80/ should throw
PASS sendBeacon(): ftp://example.com%80/ should throw
-FAIL Location's href: ftp://example.com%80/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: ftp://example.com%80/ should throw
PASS window.open(): ftp://example.com%80/ should throw
PASS URL's constructor's base argument: ftp://example.com%A0/ should throw
PASS URL's href: ftp://example.com%A0/ should throw
PASS XHR: ftp://example.com%A0/ should throw
PASS sendBeacon(): ftp://example.com%A0/ should throw
-FAIL Location's href: ftp://example.com%A0/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: ftp://example.com%A0/ should throw
PASS window.open(): ftp://example.com%A0/ should throw
PASS URL's constructor's base argument: https://example.com%80/ should throw
PASS URL's href: https://example.com%80/ should throw
PASS XHR: https://example.com%80/ should throw
PASS sendBeacon(): https://example.com%80/ should throw
-FAIL Location's href: https://example.com%80/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://example.com%80/ should throw
PASS window.open(): https://example.com%80/ should throw
PASS URL's constructor's base argument: https://example.com%A0/ should throw
PASS URL's href: https://example.com%A0/ should throw
PASS XHR: https://example.com%A0/ should throw
PASS sendBeacon(): https://example.com%A0/ should throw
-FAIL Location's href: https://example.com%A0/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://example.com%A0/ should throw
PASS window.open(): https://example.com%A0/ should throw
PASS URL's constructor's base argument: https://0x100000000/test should throw
PASS URL's href: https://0x100000000/test should throw
PASS XHR: https://0x100000000/test should throw
PASS sendBeacon(): https://0x100000000/test should throw
-FAIL Location's href: https://0x100000000/test should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://0x100000000/test should throw
PASS window.open(): https://0x100000000/test should throw
PASS URL's constructor's base argument: https://256.0.0.1/test should throw
PASS URL's href: https://256.0.0.1/test should throw
PASS XHR: https://256.0.0.1/test should throw
PASS sendBeacon(): https://256.0.0.1/test should throw
-FAIL Location's href: https://256.0.0.1/test should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://256.0.0.1/test should throw
PASS window.open(): https://256.0.0.1/test should throw
PASS URL's constructor's base argument: file://%43%3A should throw
PASS URL's href: file://%43%3A should throw
PASS XHR: file://%43%3A should throw
PASS sendBeacon(): file://%43%3A should throw
-FAIL Location's href: file://%43%3A should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://%43%3A should throw
PASS window.open(): file://%43%3A should throw
PASS URL's constructor's base argument: file://%43%7C should throw
PASS URL's href: file://%43%7C should throw
PASS XHR: file://%43%7C should throw
PASS sendBeacon(): file://%43%7C should throw
-FAIL Location's href: file://%43%7C should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://%43%7C should throw
PASS window.open(): file://%43%7C should throw
PASS URL's constructor's base argument: file://%43| should throw
PASS URL's href: file://%43| should throw
PASS XHR: file://%43| should throw
PASS sendBeacon(): file://%43| should throw
-FAIL Location's href: file://%43| should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://%43| should throw
PASS window.open(): file://%43| should throw
PASS URL's constructor's base argument: file://C%7C should throw
PASS URL's href: file://C%7C should throw
PASS XHR: file://C%7C should throw
PASS sendBeacon(): file://C%7C should throw
-FAIL Location's href: file://C%7C should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://C%7C should throw
PASS window.open(): file://C%7C should throw
PASS URL's constructor's base argument: file://%43%7C/ should throw
PASS URL's href: file://%43%7C/ should throw
PASS XHR: file://%43%7C/ should throw
PASS sendBeacon(): file://%43%7C/ should throw
-FAIL Location's href: file://%43%7C/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://%43%7C/ should throw
PASS window.open(): file://%43%7C/ should throw
PASS URL's constructor's base argument: https://%43%7C/ should throw
PASS URL's href: https://%43%7C/ should throw
PASS XHR: https://%43%7C/ should throw
PASS sendBeacon(): https://%43%7C/ should throw
-FAIL Location's href: https://%43%7C/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://%43%7C/ should throw
PASS window.open(): https://%43%7C/ should throw
PASS URL's constructor's base argument: asdf://%43|/ should throw
PASS URL's href: asdf://%43|/ should throw
PASS XHR: asdf://%43|/ should throw
PASS sendBeacon(): asdf://%43|/ should throw
-FAIL Location's href: asdf://%43|/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: asdf://%43|/ should throw
PASS window.open(): asdf://%43|/ should throw
PASS URL's constructor's base argument: \\\.\Y: should throw
PASS URL's href: \\\.\Y: should throw
@@ -398,67 +398,67 @@
PASS URL's href: https://[0::0::0] should throw
PASS XHR: https://[0::0::0] should throw
PASS sendBeacon(): https://[0::0::0] should throw
-FAIL Location's href: https://[0::0::0] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://[0::0::0] should throw
PASS window.open(): https://[0::0::0] should throw
PASS URL's constructor's base argument: https://[0:.0] should throw
PASS URL's href: https://[0:.0] should throw
PASS XHR: https://[0:.0] should throw
PASS sendBeacon(): https://[0:.0] should throw
-FAIL Location's href: https://[0:.0] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://[0:.0] should throw
PASS window.open(): https://[0:.0] should throw
PASS URL's constructor's base argument: https://[0:0:] should throw
PASS URL's href: https://[0:0:] should throw
PASS XHR: https://[0:0:] should throw
PASS sendBeacon(): https://[0:0:] should throw
-FAIL Location's href: https://[0:0:] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://[0:0:] should throw
PASS window.open(): https://[0:0:] should throw
PASS URL's constructor's base argument: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw
PASS URL's href: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw
PASS XHR: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw
PASS sendBeacon(): https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw
-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 not throw
+PASS Location's href: https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw
PASS window.open(): https://[0:1:2:3:4:5:6:7.0.0.0.1] should throw
PASS URL's constructor's base argument: https://[0:1.00.0.0.0] should throw
PASS URL's href: https://[0:1.00.0.0.0] should throw
PASS XHR: https://[0:1.00.0.0.0] should throw
PASS sendBeacon(): https://[0:1.00.0.0.0] should throw
-FAIL Location's href: https://[0:1.00.0.0.0] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://[0:1.00.0.0.0] should throw
PASS window.open(): https://[0:1.00.0.0.0] should throw
PASS URL's constructor's base argument: https://[0:1.290.0.0.0] should throw
PASS URL's href: https://[0:1.290.0.0.0] should throw
PASS XHR: https://[0:1.290.0.0.0] should throw
PASS sendBeacon(): https://[0:1.290.0.0.0] should throw
-FAIL Location's href: https://[0:1.290.0.0.0] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://[0:1.290.0.0.0] should throw
PASS window.open(): https://[0:1.290.0.0.0] should throw
PASS URL's constructor's base argument: https://[0:1.23.23] should throw
PASS URL's href: https://[0:1.23.23] should throw
PASS XHR: https://[0:1.23.23] should throw
PASS sendBeacon(): https://[0:1.23.23] should throw
-FAIL Location's href: https://[0:1.23.23] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: https://[0:1.23.23] should throw
PASS window.open(): https://[0:1.23.23] should throw
PASS URL's constructor's base argument: http://? should throw
PASS URL's href: http://? should throw
PASS XHR: http://? should throw
PASS sendBeacon(): http://? should throw
-FAIL Location's href: http://? should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://? should throw
PASS window.open(): http://? should throw
PASS URL's constructor's base argument: http://# should throw
PASS URL's href: http://# should throw
PASS XHR: http://# should throw
PASS sendBeacon(): http://# should throw
-FAIL Location's href: http://# should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://# should throw
PASS window.open(): http://# should throw
PASS URL's constructor's base argument: non-special://[:80/ should throw
PASS URL's href: non-special://[:80/ should throw
PASS XHR: non-special://[:80/ should throw
PASS sendBeacon(): non-special://[:80/ should throw
-FAIL Location's href: non-special://[:80/ should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: non-special://[:80/ should throw
PASS window.open(): non-special://[:80/ should throw
PASS URL's constructor's base argument: http://[::127.0.0.0.1] should throw
PASS URL's href: http://[::127.0.0.0.1] should throw
PASS XHR: http://[::127.0.0.0.1] should throw
PASS sendBeacon(): http://[::127.0.0.0.1] should throw
-FAIL Location's href: http://[::127.0.0.0.1] should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: http://[::127.0.0.0.1] should throw
PASS window.open(): http://[::127.0.0.0.1] should throw
PASS URL's constructor's base argument: a should throw
PASS URL's href: a should throw
@@ -470,18 +470,18 @@
PASS URL's href: file:///p should throw
PASS XHR: file:///p should throw
PASS sendBeacon(): file:///p should throw
-FAIL Location's href: file:///p should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file:///p should throw
PASS window.open(): file:///p should throw
PASS URL's constructor's base argument: file://%C2%AD/p should throw
PASS URL's href: file://%C2%AD/p should throw
PASS XHR: file://%C2%AD/p should throw
PASS sendBeacon(): file://%C2%AD/p should throw
-FAIL Location's href: file://%C2%AD/p should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://%C2%AD/p should throw
PASS window.open(): file://%C2%AD/p should throw
PASS URL's constructor's base argument: file://xn--/p should throw
PASS URL's href: file://xn--/p should throw
PASS XHR: file://xn--/p should throw
PASS sendBeacon(): file://xn--/p should throw
-FAIL Location's href: file://xn--/p should throw assert_throws_js: function "() => self[0].location = test.input" did not throw
+PASS Location's href: file://xn--/p should throw
PASS window.open(): file://xn--/p should throw
Deleted: trunk/LayoutTests/platform/ios-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt (281471 => 281472)
--- trunk/LayoutTests/platform/ios-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/platform/ios-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,7 +0,0 @@
-main frame - willPerformClientRedirectToURL: http://A=a%25B=b
-main frame - didFinishDocumentLoadForFrame
-main frame - didFinishLoadForFrame
-main frame - didCancelClientRedirectForFrame
-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".
-
-Note, this test must be run in DumpRenderTree.
Deleted: trunk/LayoutTests/platform/mac-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt (281471 => 281472)
--- trunk/LayoutTests/platform/mac-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/LayoutTests/platform/mac-wk1/fast/loader/redirect-to-invalid-url-using-_javascript_-disallowed-expected.txt 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,15 +0,0 @@
-main frame - didFinishDocumentLoadForFrame
-main frame - willPerformClientRedirectToURL: http://A=a%25B=b
-main frame - didHandleOnloadEventsForFrame
-main frame - didFinishLoadForFrame
-main frame - didCancelClientRedirectForFrame
-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".
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS testRunner.didCancelClientRedirect became true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Modified: trunk/Source/WebCore/ChangeLog (281471 => 281472)
--- trunk/Source/WebCore/ChangeLog 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/Source/WebCore/ChangeLog 2021-08-23 21:39:37 UTC (rev 281472)
@@ -1,3 +1,15 @@
+2021-08-23 Alex Christensen <[email protected]>
+
+ Setting window.location.href to an invalid URL should throw a TypeError
+ https://bugs.webkit.org/show_bug.cgi?id=229303
+
+ Reviewed by Chris Dumez.
+
+ This matches Firefox and the specification, and Chrome also throws an exception in this case.
+
+ * page/Location.cpp:
+ (WebCore::Location::setLocation):
+
2021-08-23 Cameron McCormack <[email protected]>
Preserve color space when getting current color in DisplayList::DrawGlyphsRecorder
Modified: trunk/Source/WebCore/page/Location.cpp (281471 => 281472)
--- trunk/Source/WebCore/page/Location.cpp 2021-08-23 21:38:41 UTC (rev 281471)
+++ trunk/Source/WebCore/page/Location.cpp 2021-08-23 21:39:37 UTC (rev 281472)
@@ -277,9 +277,8 @@
URL completedURL = firstFrame->document()->completeURL(urlString);
- // FIXME: The specification says to throw a SyntaxError if the URL is not valid.
- if (completedURL.isNull())
- return { };
+ if (!completedURL.isValid())
+ return Exception { TypeError, "Invalid URL"_s };
if (!incumbentWindow.document()->canNavigate(frame, completedURL))
return Exception { SecurityError };