Title: [236560] trunk
Revision
236560
Author
[email protected]
Date
2018-09-27 11:15:55 -0700 (Thu, 27 Sep 2018)

Log Message

Fragment should be stripped from document URL during document.open() URL propagation
https://bugs.webkit.org/show_bug.cgi?id=189374
<rdar://problem/44282736>

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that it is passing.

* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window-expected.txt:

Source/WebCore:

Strip the Document URL fragment during document.open() URL propagation if the entry document
is not the current document, as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 11.2.)

No new tests, rebaselined existing test.

* dom/Document.cpp:
(WebCore::Document::open):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (236559 => 236560)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-09-27 17:50:34 UTC (rev 236559)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-09-27 18:15:55 UTC (rev 236560)
@@ -1,3 +1,15 @@
+2018-09-27  Chris Dumez  <[email protected]>
+
+        Fragment should be stripped from document URL during document.open() URL propagation
+        https://bugs.webkit.org/show_bug.cgi?id=189374
+        <rdar://problem/44282736>
+
+        Reviewed by Alex Christensen.
+
+        Rebaseline WPT test now that it is passing.
+
+        * web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window-expected.txt:
+
 2018-09-27  Youenn Fablet  <[email protected]>
 
         Add VP8 support to WebRTC

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window-expected.txt (236559 => 236560)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window-expected.txt	2018-09-27 17:50:34 UTC (rev 236559)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window-expected.txt	2018-09-27 18:15:55 UTC (rev 236560)
@@ -1,4 +1,4 @@
 
-FAIL document.open() and document's URL containing a fragment (entry is not relevant) assert_equals: expected "http://localhost:8800/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window.html" but got "http://localhost:8800/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url-fragment.window.html#heya"
+PASS document.open() and document's URL containing a fragment (entry is not relevant) 
 PASS document.open() and document's URL containing a fragment (entry is relevant) 
 

Modified: trunk/Source/WebCore/ChangeLog (236559 => 236560)


--- trunk/Source/WebCore/ChangeLog	2018-09-27 17:50:34 UTC (rev 236559)
+++ trunk/Source/WebCore/ChangeLog	2018-09-27 18:15:55 UTC (rev 236560)
@@ -1,3 +1,20 @@
+2018-09-27  Chris Dumez  <[email protected]>
+
+        Fragment should be stripped from document URL during document.open() URL propagation
+        https://bugs.webkit.org/show_bug.cgi?id=189374
+        <rdar://problem/44282736>
+
+        Reviewed by Alex Christensen.
+
+        Strip the Document URL fragment during document.open() URL propagation if the entry document
+        is not the current document, as per:
+        - https://html.spec.whatwg.org/#document-open-steps (Step 11.2.)
+
+        No new tests, rebaselined existing test.
+
+        * dom/Document.cpp:
+        (WebCore::Document::open):
+
 2018-09-27  Youenn Fablet  <[email protected]>
 
         Add VP8 support to WebRTC

Modified: trunk/Source/WebCore/dom/Document.cpp (236559 => 236560)


--- trunk/Source/WebCore/dom/Document.cpp	2018-09-27 17:50:34 UTC (rev 236559)
+++ trunk/Source/WebCore/dom/Document.cpp	2018-09-27 18:15:55 UTC (rev 236560)
@@ -2696,8 +2696,14 @@
     removeAllEventListeners();
 
     if (responsibleDocument && isFullyActive()) {
-        setURL(responsibleDocument->url());
-        setCookieURL(responsibleDocument->cookieURL());
+        auto newURL = responsibleDocument->url();
+        if (responsibleDocument != this)
+            newURL.removeFragmentIdentifier();
+        setURL(newURL);
+        auto newCookieURL = responsibleDocument->cookieURL();
+        if (responsibleDocument != this)
+            newCookieURL.removeFragmentIdentifier();
+        setCookieURL(newCookieURL);
         setSecurityOriginPolicy(responsibleDocument->securityOriginPolicy());
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to