[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

weinig at apple.com weinig at apple.com
Thu Oct 29 20:32:46 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 50891b72d4245cc663dd8d392e9bedd0c231c832
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 24 01:56:53 2009 +0000

    WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=26989
    Should allow navigation of top-level openers
    <rdar://problem/7034025>
    
    Reviewed by Adam Barth.
    
    Allow navigation of cross-origin window.opener if it is top-level frame.
    
    Test: http/tests/security/frameNavigation/cross-origin-opener.html
    
    * loader/FrameLoader.cpp:
    (WebCore::FrameLoader::shouldAllowNavigation):
    
    LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=26989
    Should allow navigation of top-level openers
    <rdar://problem/7034025>
    
    Reviewed by Adam Barth.
    
    * http/tests/security/frameNavigation/cross-origin-opener-expected.txt: Added.
    * http/tests/security/frameNavigation/cross-origin-opener.html: Added.
    * http/tests/security/frameNavigation/resources/cross-origin-opener-opener.html: Added.
    * http/tests/security/frameNavigation/resources/navigate-opener.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48695 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9e5d0a4..4512783 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-09-23  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Test for https://bugs.webkit.org/show_bug.cgi?id=26989
+        Should allow navigation of top-level openers
+        <rdar://problem/7034025>
+
+        * http/tests/security/frameNavigation/cross-origin-opener-expected.txt: Added.
+        * http/tests/security/frameNavigation/cross-origin-opener.html: Added.
+        * http/tests/security/frameNavigation/resources/cross-origin-opener-opener.html: Added.
+        * http/tests/security/frameNavigation/resources/navigate-opener.html: Added.
+
 2009-09-23  Andrew Scherkus  <scherkus at chromium.org>
 
         Reviewed by Eric Carlson.
diff --git a/LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt b/LayoutTests/http/tests/security/frameNavigation/cross-origin-opener-expected.txt
similarity index 100%
copy from LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt
copy to LayoutTests/http/tests/security/frameNavigation/cross-origin-opener-expected.txt
diff --git a/LayoutTests/http/tests/security/frameNavigation/cross-origin-opener.html b/LayoutTests/http/tests/security/frameNavigation/cross-origin-opener.html
new file mode 100644
index 0000000..ed48ca4
--- /dev/null
+++ b/LayoutTests/http/tests/security/frameNavigation/cross-origin-opener.html
@@ -0,0 +1,33 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.setCanOpenWindows();
+}
+
+function log(msg)
+{
+    document.getElementById("console").appendChild(document.createTextNode(msg + "\n"));
+}
+
+window.addEventListener("message", function(e) {
+    if (e.data == "pass") {
+        log("PASS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}, false);
+
+window.onload = function() {
+    win = window.open("resources/cross-origin-opener-opener.html");
+}
+
+</script>
+</head>
+<body>
+<pre id="console"></pre>
+</body>
+</html>
+
diff --git a/LayoutTests/http/tests/security/frameNavigation/resources/cross-origin-opener-opener.html b/LayoutTests/http/tests/security/frameNavigation/resources/cross-origin-opener-opener.html
new file mode 100644
index 0000000..375c654
--- /dev/null
+++ b/LayoutTests/http/tests/security/frameNavigation/resources/cross-origin-opener-opener.html
@@ -0,0 +1,4 @@
+<script>
+    var win = window.open("http://localhost:8000/security/frameNavigation/resources/navigate-opener.html");
+</script>
+Helper window. Will be navigated by the window it is opening.
diff --git a/LayoutTests/http/tests/security/frameNavigation/resources/navigate-opener.html b/LayoutTests/http/tests/security/frameNavigation/resources/navigate-opener.html
new file mode 100644
index 0000000..5d2514a
--- /dev/null
+++ b/LayoutTests/http/tests/security/frameNavigation/resources/navigate-opener.html
@@ -0,0 +1,4 @@
+<script>
+opener.location = "pass.html";
+</script>
+Navigates opener to "pass.html".
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4e95f0b..0c0f6a2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-09-23  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=26989
+        Should allow navigation of top-level openers
+        <rdar://problem/7034025>
+
+        Allow navigation of cross-origin window.opener if it is top-level frame.
+
+        Test: http/tests/security/frameNavigation/cross-origin-opener.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::shouldAllowNavigation):
+
 2009-09-23  Marshall Culpepper  <mculpepper at appcelerator.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index f48c607..f5ff025 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -2697,7 +2697,8 @@ bool FrameLoader::shouldAllowNavigation(Frame* targetFrame) const
     //
     // Or the target frame is:
     //   - a top-level frame in the frame hierarchy and the active frame can
-    //     navigate the target frame's opener per above.
+    //     navigate the target frame's opener per above or it is the opener of
+    //     the target frame.
 
     if (!targetFrame)
         return true;
@@ -2712,6 +2713,10 @@ bool FrameLoader::shouldAllowNavigation(Frame* targetFrame) const
     if (targetFrame == m_frame->tree()->top())
         return true;
 
+    // Let a frame navigate its opener if the opener is a top-level window.
+    if (!targetFrame->tree()->parent() && m_frame->loader()->opener() == targetFrame)
+        return true;
+
     Document* activeDocument = m_frame->document();
     ASSERT(activeDocument);
     const SecurityOrigin* activeSecurityOrigin = activeDocument->securityOrigin();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list