XMLHttpRequest.responseXML url should be the HTTP response URL
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Oct 2019 16:24:00 +0000 (16:24 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Oct 2019 16:24:00 +0000 (16:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203289

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/xhr-response-url.https-expected.txt:
* web-platform-tests/xhr/responsexml-document-properties-expected.txt:

Source/WebCore:

Follow https://xhr.spec.whatwg.org/#document-response step 9.
Covered by rebased tests.

* xml/XMLHttpRequest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251542 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-response-url.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/xhr/responsexml-document-properties-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/xml/XMLHttpRequest.cpp

index 229a248..36becf1 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-24  youenn fablet  <youenn@apple.com>
+
+        XMLHttpRequest.responseXML url should be the HTTP response URL
+        https://bugs.webkit.org/show_bug.cgi?id=203289
+
+        Reviewed by Chris Dumez.
+
+        * web-platform-tests/service-workers/service-worker/xhr-response-url.https-expected.txt:
+        * web-platform-tests/xhr/responsexml-document-properties-expected.txt:
+
 2019-10-24  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Update WPT tests related to Web Animations and remove imported Mozilla tests
index c31fc55..bdc4f51 100644 (file)
@@ -2,7 +2,7 @@
 PASS global setup 
 PASS XHR responseURL should be the response URL 
 PASS XHR responseURL should be the response URL (generated response) 
-FAIL XHR Document should use the response URL assert_equals: responseXML.URL expected "https://localhost:9443/service-workers/service-worker/resources/blank.html" but got "https://localhost:9443/service-workers/service-worker/test?respondWith=fetch&url=https%3A%2F%2Flocalhost%3A9443%2Fservice-workers%2Fservice-worker%2Fresources%2Fblank.html"
+PASS XHR Document should use the response URL 
 PASS XHR Document should use the response URL (generated response) 
 PASS global cleanup 
 
index 6ce2cb0..dbef27c 100644 (file)
@@ -13,8 +13,8 @@ PASS body
 PASS doctype 
 FAIL all assert_equals: expected undefined but got [object HTMLAllCollection]
 PASS cookie 
-FAIL Test document URL properties after redirect assert_equals: expected "http://localhost:8800/xhr/resources/well-formed.xml" but got "http://localhost:8800/xhr/resources/redirect.py?location=well-formed.xml"
-FAIL Test document URL properties of document with <base> after redirect assert_equals: expected "http://localhost:8800/xhr/resources/base.xml" but got "http://localhost:8800/xhr/resources/redirect.py?location=base.xml"
+PASS Test document URL properties after redirect 
+PASS Test document URL properties of document with <base> after redirect 
 PASS lastModified set to time of response if no HTTP header provided 
 PASS lastModified set to related HTTP header if provided 
 PASS cookie (after setting it) 
index ab44921..fabd844 100644 (file)
@@ -1,3 +1,15 @@
+2019-10-24  youenn fablet  <youenn@apple.com>
+
+        XMLHttpRequest.responseXML url should be the HTTP response URL
+        https://bugs.webkit.org/show_bug.cgi?id=203289
+
+        Reviewed by Chris Dumez.
+
+        Follow https://xhr.spec.whatwg.org/#document-response step 9.
+        Covered by rebased tests.
+
+        * xml/XMLHttpRequest.cpp:
+
 2019-10-24  Antti Koivisto  <antti@apple.com>
 
         Move property cascade out of StyleResolver
index 152274f..696fd38 100644 (file)
@@ -184,9 +184,9 @@ ExceptionOr<Document*> XMLHttpRequest::responseXML()
             m_responseDocument = nullptr;
         } else {
             if (isHTML)
-                m_responseDocument = HTMLDocument::create(nullptr, m_url);
+                m_responseDocument = HTMLDocument::create(nullptr, m_response.url());
             else
-                m_responseDocument = XMLDocument::create(nullptr, m_url);
+                m_responseDocument = XMLDocument::create(nullptr, m_response.url());
             m_responseDocument->overrideLastModified(m_response.lastModified());
             m_responseDocument->setContent(m_responseBuilder.toStringPreserveCapacity());
             m_responseDocument->setContextDocument(context);