Title: [236179] releases/WebKitGTK/webkit-2.22
Revision
236179
Author
carlo...@webkit.org
Date
2018-09-19 05:34:27 -0700 (Wed, 19 Sep 2018)

Log Message

Merge r235808 - XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved
https://bugs.webkit.org/show_bug.cgi?id=46008

Patch by Rob Buis <rb...@igalia.com> on 2018-09-07
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/open-url-bogus-expected.txt:
* web-platform-tests/xhr/open-url-multi-window-6-expected.txt:

Source/WebCore:

Check if passed URL is valid as specified here [1].

Test: web-platform-tests/xhr/open-url-bogus.htm

[1] https://xhr.spec.whatwg.org/#the-open()-method Step 7

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/ChangeLog (236178 => 236179)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/ChangeLog	2018-09-19 12:34:21 UTC (rev 236178)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/ChangeLog	2018-09-19 12:34:27 UTC (rev 236179)
@@ -1,3 +1,13 @@
+2018-09-07  Rob Buis  <rb...@igalia.com>
+
+        XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved
+        https://bugs.webkit.org/show_bug.cgi?id=46008
+
+        Reviewed by Chris Dumez.
+
+        * web-platform-tests/xhr/open-url-bogus-expected.txt:
+        * web-platform-tests/xhr/open-url-multi-window-6-expected.txt:
+
 2018-08-27  Rob Buis  <rb...@igalia.com>
 
         XMLHTTPRequest.send for Document should have same Content-Type processing rules as String

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-bogus-expected.txt (236178 => 236179)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-bogus-expected.txt	2018-09-19 12:34:21 UTC (rev 236178)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-bogus-expected.txt	2018-09-19 12:34:27 UTC (rev 236179)
@@ -1,7 +1,7 @@
 
-FAIL XMLHttpRequest: open() - bogus URLs (//[) assert_throws: function "function () { client.open("GET", url) }" did not throw
+PASS XMLHttpRequest: open() - bogus URLs (//[) 
 FAIL XMLHttpRequest: open() - bogus URLs (ftp:) assert_throws: function "function () { client.open("GET", url) }" did not throw
-FAIL XMLHttpRequest: open() - bogus URLs (http://a a/) assert_throws: function "function () { client.open("GET", url) }" did not throw
-FAIL XMLHttpRequest: open() - bogus URLs (http:////////////) assert_throws: function "function () { client.open("GET", url) }" did not throw
-FAIL XMLHttpRequest: open() - bogus URLs (http://u:p@/) assert_throws: function "function () { client.open("GET", url) }" did not throw
+PASS XMLHttpRequest: open() - bogus URLs (http://a a/) 
+PASS XMLHttpRequest: open() - bogus URLs (http:////////////) 
+PASS XMLHttpRequest: open() - bogus URLs (http://u:p@/) 
 

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt (236178 => 236179)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt	2018-09-19 12:34:21 UTC (rev 236178)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-6-expected.txt	2018-09-19 12:34:27 UTC (rev 236179)
@@ -1,3 +1,3 @@
 
-FAIL XMLHttpRequest: open() in document that is not fully active (but may be active) should throw assert_throws: function "function () { client.open("GET", "...") }" did not throw
+FAIL XMLHttpRequest: open() in document that is not fully active (but may be active) should throw assert_throws: function "function () { client.open("GET", "...") }" threw object "SyntaxError: The string did not match the expected pattern." that is not a DOMException InvalidStateError: property "code" is equal to 12, expected 11
 

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (236178 => 236179)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-09-19 12:34:21 UTC (rev 236178)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-09-19 12:34:27 UTC (rev 236179)
@@ -1,3 +1,19 @@
+2018-09-07  Rob Buis  <rb...@igalia.com>
+
+        XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved
+        https://bugs.webkit.org/show_bug.cgi?id=46008
+
+        Reviewed by Chris Dumez.
+
+        Check if passed URL is valid as specified here [1].
+
+        Test: web-platform-tests/xhr/open-url-bogus.htm
+
+        [1] https://xhr.spec.whatwg.org/#the-open()-method Step 7
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::open):
+
 2018-09-07  Don Olmstead  <don.olmst...@sony.com>
 
         [AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY)

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/xml/XMLHttpRequest.cpp (236178 => 236179)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/xml/XMLHttpRequest.cpp	2018-09-19 12:34:21 UTC (rev 236178)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/xml/XMLHttpRequest.cpp	2018-09-19 12:34:27 UTC (rev 236179)
@@ -343,6 +343,9 @@
     if (isForbiddenMethod(method))
         return Exception { SecurityError };
 
+    if (!url.isValid())
+        return Exception { SyntaxError };
+
     if (!async && scriptExecutionContext()->isDocument()) {
         // Newer functionality is not available to synchronous requests in window contexts, as a spec-mandated
         // attempt to discourage synchronous XHR use. responseType is one such piece of functionality.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to