Title: [204833] releases/WebKitGTK/webkit-2.12
Revision
204833
Author
[email protected]
Date
2016-08-23 06:43:50 -0700 (Tue, 23 Aug 2016)

Log Message

Merge r202174 - Ignore case in the check for security origin inheritance
https://bugs.webkit.org/show_bug.cgi?id=158878

Reviewed by Alex Christensen.

Source/WebCore:

Darin Adler commented in https://bugs.webkit.org/show_bug.cgi?id=158855:
"Are these comparisons intentionally case sensitive? Shouldn’t they ignore ASCII
case? We could use equalIgnoringASCIICase and equalLettersIgnoringASCIICase for
those two lines instead of using ==. URL::parse normalizes letters in the scheme
and host by using toASCIILower, but does not normalize letters elsewhere in the
URL, such as in the "blank" or "srcdoc" in the above URLs."

Test: http/tests/dom/window-open-about-uppercase-blank-and-access-document.html

* platform/URL.cpp:
(WebCore::URL::shouldInheritSecurityOriginFromOwner):

LayoutTests:

* http/tests/dom/window-open-about-uppercase-blank-and-access-document-expected.txt: Added.
* http/tests/dom/window-open-about-uppercase-blank-and-access-document.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (204832 => 204833)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 13:43:37 UTC (rev 204832)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 13:43:50 UTC (rev 204833)
@@ -1,3 +1,13 @@
+2016-06-17  John Wilander  <[email protected]>
+
+        Ignore case in the check for security origin inheritance
+        https://bugs.webkit.org/show_bug.cgi?id=158878
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/dom/window-open-about-uppercase-blank-and-access-document-expected.txt: Added.
+        * http/tests/dom/window-open-about-uppercase-blank-and-access-document.html: Added.
+
 2016-06-16  John Wilander  <[email protected]>
 
         Restrict security origin inheritance to empty, about:blank, and about:srcdoc URLs

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/dom/window-open-about-uppercase-blank-and-access-document-expected.txt (0 => 204833)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/dom/window-open-about-uppercase-blank-and-access-document-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/dom/window-open-about-uppercase-blank-and-access-document-expected.txt	2016-08-23 13:43:50 UTC (rev 204833)
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 1: Injected script running.
+PASS newWindow.document is defined.
+

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/dom/window-open-about-uppercase-blank-and-access-document.html (0 => 204833)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/dom/window-open-about-uppercase-blank-and-access-document.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/dom/window-open-about-uppercase-blank-and-access-document.html	2016-08-23 13:43:50 UTC (rev 204833)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Tests opening a new about:blank window and accessing its document</title>
+    <script src=""
+    <script>
+        var newWindow;
+
+        if (window.testRunner) {
+            testRunner.setCanOpenWindows();
+            testRunner.waitUntilDone();
+            testRunner.setPopupBlockingEnabled(false);
+        }
+
+        function checkNewWindowDocumentIsDefined () {
+            shouldBeDefined("newWindow.document");
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }
+
+        function run() {
+            newWindow = window.open("about:BLANK");
+            try {
+                newWindow.document.write("<scri" + "pt>console.log('Injected script running.')</sc" + "ript>");
+                setTimeout(checkNewWindowDocumentIsDefined, 500);
+            } catch (e) {
+                testFailed("Was not able to write to the new window's document.");
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }
+        }
+    </script>
+</head>
+<body _onload_="run()">
+<div id="console"></div>
+</body>
+</html>
\ No newline at end of file

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (204832 => 204833)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 13:43:37 UTC (rev 204832)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 13:43:50 UTC (rev 204833)
@@ -1,3 +1,22 @@
+2016-06-17  John Wilander  <[email protected]>
+
+        Ignore case in the check for security origin inheritance
+        https://bugs.webkit.org/show_bug.cgi?id=158878
+
+        Reviewed by Alex Christensen.
+
+        Darin Adler commented in https://bugs.webkit.org/show_bug.cgi?id=158855:
+        "Are these comparisons intentionally case sensitive? Shouldn’t they ignore ASCII 
+        case? We could use equalIgnoringASCIICase and equalLettersIgnoringASCIICase for 
+        those two lines instead of using ==. URL::parse normalizes letters in the scheme 
+        and host by using toASCIILower, but does not normalize letters elsewhere in the 
+        URL, such as in the "blank" or "srcdoc" in the above URLs."
+
+        Test: http/tests/dom/window-open-about-uppercase-blank-and-access-document.html
+
+        * platform/URL.cpp:
+        (WebCore::URL::shouldInheritSecurityOriginFromOwner):
+
 2016-06-16  John Wilander  <[email protected]>
 
         Restrict security origin inheritance to empty, about:blank, and about:srcdoc URLs

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/URL.cpp (204832 => 204833)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/URL.cpp	2016-08-23 13:43:37 UTC (rev 204832)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/URL.cpp	2016-08-23 13:43:50 UTC (rev 204833)
@@ -2025,8 +2025,8 @@
 bool URL::shouldInheritSecurityOriginFromOwner() const
 {
     return isEmpty()
-        || m_string == blankURL().string()
-        || m_string == "about:srcdoc";
+        || equalIgnoringASCIICase(m_string, blankURL().string())
+        || equalLettersIgnoringASCIICase(m_string, "about:srcdoc");
 }
 
 typedef HashMap<String, unsigned short, ASCIICaseInsensitiveHash> DefaultPortsMap;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to