open() does not throw a SYNTAX_ERR exception if method is empty. It does throw if method contains invalid string. The XHR spec says: open(method, url, async, user, password) Sets the request method, request URL, asynchronous flag, request username, and request password. Throws a SYNTAX_ERR exception if one of the following is true: method is not a valid HTTP method. TEST: http://tc.labs.opera.com/apis/XMLHttpRequest/open-method-bogus.htm
Per the XHR spec, we should also throw a SYNTAX_ERR exception if url cannot be resolved. http://tc.labs.opera.com/apis/XMLHttpRequest/open-url-bogus.htm
Created attachment 118359 [details] This patch checks if a url is invalid and throw syntax error if that's the case
Comment on attachment 118359 [details] This patch checks if a url is invalid and throw syntax error if that's the case A fix like this needs to come with regression tests. A good place to add one is fast/xmlhttprequest.
Created attachment 349179 [details] Patch
*** Bug 189426 has been marked as a duplicate of this bug. ***
Comment on attachment 349179 [details] Patch r=me
Comment on attachment 349179 [details] Patch Clearing flags on attachment: 349179 Committed r235808: <https://trac.webkit.org/changeset/235808>
All reviewed patches have been landed. Closing bug.
<rdar://problem/44239386>
This patch has regressed the following test in all platforms: imported/w3c/web-platform-tests/url/failure.html https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#tests=imported%2Fw3c%2Fweb-platform-tests%2Furl%2Ffailure.html&revision=235825 e.g: FAIL XHR: http://user@/www.example.com should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
New passes. The test merely needs rebaselining.
(In reply to Chris Dumez from comment #11) > New passes. The test merely needs rebaselining. Done in <https://trac.webkit.org/changeset/235958>.