Steps to reproduce Go to any site Open the console Type window.location.replace('//') What should happen? As per spec https://www.w3.org/TR/html5/browsers.html#dom-location-replace it should throw an exception What actually happen? It shows a error html page saying "Safari can't open the page "https:whatever/" because the page's address is invalid" and doesn't throw at all.
Created attachment 402997 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Created attachment 402998 [details] Patch
Created attachment 403002 [details] Patch
WPT test is exported as https://github.com/web-platform-tests/wpt/pull/24374.
Comment on attachment 403002 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=403002&action=review > Source/WebCore/page/Location.cpp:232 > + if (completedURL.isNull() || !completedURL.isValid()) I wonder if null URLs can ever be valid. If not, then the isNull check is not needed.
Created attachment 403032 [details] Patch
Committed r263647: <https://trac.webkit.org/changeset/263647> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403032 [details].
<rdar://problem/64879675>