[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

dbates at webkit.org dbates at webkit.org
Wed Dec 22 15:25:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8fb8b7eb9be389ea9ad762d95ba465c052672db4
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 3 07:48:19 2010 +0000

    2010-11-03  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Adam Barth.
    
            For unnamed frames, window.name returns a generated name
            https://bugs.webkit.org/show_bug.cgi?id=6751
    
            Part 2 of 2.
    
            Fixes an issue where the window.name of an unnamed frame returns
            a unique generated name that is used internally to identify the
            frame. Instead, we should return an empty string as implied by
            section 5.1.6 of the HTML5 spec. (http://www.w3.org/TR/html5/browsers.html#browsing-context-names).
            This section describes that a browsing context can have no name or be
            the empty string.
    
            * html/HTMLFrameElementBase.cpp:
            (WebCore::HTMLFrameElementBase::openURL): Removed ASSERT for empty
            frame name since this is valid as per the HTML5 spec.
            (WebCore::HTMLFrameElementBase::setName): Removed the call to FrameTree::uniqueChildName()
            since the loader code no longer depends on the frame name being unique.
            * page/DOMWindow.cpp:
            (WebCore::DOMWindow::name): Modified to call FrameTree::name().
            * page/FrameTree.cpp:
            (WebCore::FrameTree::setName):
            (WebCore::FrameTree::clearName):
            * page/FrameTree.h:
            (WebCore::FrameTree::name): Re-added; returns the DOM-specified name of the
            frame. Previously, this method returned the internal frame name.
    
    2010-11-03  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Adam Barth.
    
            For unnamed frames, window.name returns a generated name
            https://bugs.webkit.org/show_bug.cgi?id=6751
    
            Part 2 of 2.
    
            Updated resources of test case fast/frames/frame-element-name.html to
            check the value of window.name. Also modified test case fast/frames/iframe-set-inner-html.html
            to use layoutTestController.dumpChildFramesAsText() and rebased the
            results of http/tests/security/cross-frame-access-put-expected.txt.
    
            * fast/frames/frame-element-name-expected.txt: Updated results.
            * fast/frames/iframe-set-inner-html-expected.txt: Updated results.
            * fast/frames/iframe-set-inner-html.html: Modified test to use
            layoutTestController.dumpChildFramesAsText() instead of window.name.
            since window.name no longer exposes the WebKit internal frame name.
            * fast/frames/resources/frame-element-name-left.html: Added test for window.name.
            * fast/frames/resources/frame-element-name-right.html: Ditto.
            * http/tests/security/cross-frame-access-put-expected.txt: Updated results.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71219 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index db993f4..ededd5f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-03  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Adam Barth.
+
+        For unnamed frames, window.name returns a generated name
+        https://bugs.webkit.org/show_bug.cgi?id=6751
+
+        Part 2 of 2.
+
+        Updated resources of test case fast/frames/frame-element-name.html to
+        check the value of window.name. Also modified test case fast/frames/iframe-set-inner-html.html
+        to use layoutTestController.dumpChildFramesAsText() and rebased the
+        results of http/tests/security/cross-frame-access-put-expected.txt.
+
+        * fast/frames/frame-element-name-expected.txt: Updated results.
+        * fast/frames/iframe-set-inner-html-expected.txt: Updated results.
+        * fast/frames/iframe-set-inner-html.html: Modified test to use
+        layoutTestController.dumpChildFramesAsText() instead of window.name.
+        since window.name no longer exposes the WebKit internal frame name.
+        * fast/frames/resources/frame-element-name-left.html: Added test for window.name.
+        * fast/frames/resources/frame-element-name-right.html: Ditto.
+        * http/tests/security/cross-frame-access-put-expected.txt: Updated results.
+
 2010-11-03  takano takumi  <takano1 at asia.apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/frames/frame-element-name-expected.txt b/LayoutTests/fast/frames/frame-element-name-expected.txt
index efcb192..8d6a136 100644
--- a/LayoutTests/fast/frames/frame-element-name-expected.txt
+++ b/LayoutTests/fast/frames/frame-element-name-expected.txt
@@ -4,10 +4,12 @@
 Frame: 'left'
 --------
 PASS escape(window.frameElement.name) is "left"
+PASS escape(window.name) is "left"
 
 
 --------
 Frame: '<!--framePath //<!--frame1-->-->'
 --------
 PASS escape(window.frameElement.name) is ""
+PASS escape(window.name) is ""
 
diff --git a/LayoutTests/fast/frames/iframe-set-inner-html-expected.txt b/LayoutTests/fast/frames/iframe-set-inner-html-expected.txt
index 63dd172..f0da833 100644
--- a/LayoutTests/fast/frames/iframe-set-inner-html-expected.txt
+++ b/LayoutTests/fast/frames/iframe-set-inner-html-expected.txt
@@ -1,3 +1,12 @@
 
 This tests that inserting two <iframe> elements using innerHTML actually causes two frames with unique names to be created.
-SUCCESS
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+
+
+--------
+Frame: '<!--framePath //<!--frame1-->-->'
+--------
+
diff --git a/LayoutTests/fast/frames/iframe-set-inner-html.html b/LayoutTests/fast/frames/iframe-set-inner-html.html
index e8cded4..e7d800b 100644
--- a/LayoutTests/fast/frames/iframe-set-inner-html.html
+++ b/LayoutTests/fast/frames/iframe-set-inner-html.html
@@ -1,30 +1,18 @@
 <html>
 <script>
 function runTest() {
-    if (window.layoutTestController)
+    if (window.layoutTestController) {
         layoutTestController.dumpAsText();
-        
-    var c = document.getElementById('container');
-    var r = document.getElementById('result');
-    
-    c.innerHTML = "<span><iframe></iframe><iframe></iframe></span>"
-    
-    if (window.frames.length != 2) {
-        r.innerHTML = 'FAILURE - number of frames should be 2, was ' + window.frames.length;
-        return;
+        layoutTestController.dumpChildFramesAsText();
     }
     
-    if (window.frames[0].name == window.frames[1].name) {
-        r.innerHTML = 'FAILURE - both windows had tne same name'
-        return;
-    }
+    var c = document.getElementById('container');
     
-    r.innerHTML = 'SUCCESS';
+    c.innerHTML = "<span><iframe></iframe><iframe></iframe></span>"
 }
 </script>
 <body onload="runTest()">
 <div id="container"></div>
 <div>This tests that inserting two &lt;iframe&gt; elements using innerHTML actually causes two frames with unique names to be created.</div>
-<div id="result">FAILURE</div>
 </body>
 </html>
diff --git a/LayoutTests/fast/frames/resources/frame-element-name-left.html b/LayoutTests/fast/frames/resources/frame-element-name-left.html
index 3c0c59d..da9d9e1 100644
--- a/LayoutTests/fast/frames/resources/frame-element-name-left.html
+++ b/LayoutTests/fast/frames/resources/frame-element-name-left.html
@@ -7,5 +7,6 @@
 <div id="console"></div>
 <script>
 shouldBeEqualToString("escape(window.frameElement.name)", "left");
+shouldBeEqualToString("escape(window.name)", "left");
 </script>
 </body>
diff --git a/LayoutTests/fast/frames/resources/frame-element-name-right.html b/LayoutTests/fast/frames/resources/frame-element-name-right.html
index c09bb59..6ab8dfa 100644
--- a/LayoutTests/fast/frames/resources/frame-element-name-right.html
+++ b/LayoutTests/fast/frames/resources/frame-element-name-right.html
@@ -7,5 +7,6 @@
 <div id="console"></div>
 <script>
 shouldBeEqualToString("escape(window.frameElement.name)", "");
+shouldBeEqualToString("escape(window.name)", "");
 </script>
 </body>
diff --git a/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt b/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt
index be9d15b..b18acea 100644
--- a/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt
+++ b/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt
@@ -484,7 +484,7 @@ ALERT: PASS: window.innerWidth should be '300' and is.
 ALERT: PASS: window.length should be '0' and is.
 ALERT: PASS: window.locationbar should be '[object BarInfo]' and is.
 ALERT: PASS: window.menubar should be '[object BarInfo]' and is.
-ALERT: PASS: window.name should be '<!--framePath //<!--frame0-->-->' and is.
+ALERT: PASS: window.name should be '' and is.
 ALERT: PASS: window.navigator should be '[object Navigator]' and is.
 ALERT: PASS: window.offscreenBuffering should be 'true' and is.
 ALERT: PASS: window.onabort should be 'null' and is.
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0391a3b..e259a7d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-11-03  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Adam Barth.
+
+        For unnamed frames, window.name returns a generated name
+        https://bugs.webkit.org/show_bug.cgi?id=6751
+
+        Part 2 of 2.
+
+        Fixes an issue where the window.name of an unnamed frame returns
+        a unique generated name that is used internally to identify the
+        frame. Instead, we should return an empty string as implied by
+        section 5.1.6 of the HTML5 spec. (http://www.w3.org/TR/html5/browsers.html#browsing-context-names).
+        This section describes that a browsing context can have no name or be
+        the empty string.
+
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::openURL): Removed ASSERT for empty
+        frame name since this is valid as per the HTML5 spec.
+        (WebCore::HTMLFrameElementBase::setName): Removed the call to FrameTree::uniqueChildName()
+        since the loader code no longer depends on the frame name being unique.
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::name): Modified to call FrameTree::name().
+        * page/FrameTree.cpp:
+        (WebCore::FrameTree::setName):
+        (WebCore::FrameTree::clearName):
+        * page/FrameTree.h:
+        (WebCore::FrameTree::name): Re-added; returns the DOM-specified name of the
+        frame. Previously, this method returned the internal frame name.
+
 2010-11-03  takano takumi  <takano1 at asia.apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp
index d153845..cba82a2 100644
--- a/WebCore/html/HTMLFrameElementBase.cpp
+++ b/WebCore/html/HTMLFrameElementBase.cpp
@@ -92,8 +92,6 @@ bool HTMLFrameElementBase::isURLAllowed() const
 
 void HTMLFrameElementBase::openURL(bool lockHistory, bool lockBackForwardList)
 {
-    ASSERT(!m_frameName.isEmpty());
-
     if (!isURLAllowed())
         return;
 
@@ -155,9 +153,6 @@ void HTMLFrameElementBase::setName()
     m_frameName = getAttribute(nameAttr);
     if (m_frameName.isNull())
         m_frameName = getIdAttribute();
-    
-    if (Frame* parentFrame = document()->frame())
-        m_frameName = parentFrame->tree()->uniqueChildName(m_frameName);
 }
 
 void HTMLFrameElementBase::setNameAndOpenURL()
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 3fe4e76..8779aaa 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -1136,7 +1136,7 @@ String DOMWindow::name() const
     if (!m_frame)
         return String();
 
-    return m_frame->tree()->uniqueName();
+    return m_frame->tree()->name();
 }
 
 void DOMWindow::setName(const String& string)
diff --git a/WebCore/page/FrameTree.cpp b/WebCore/page/FrameTree.cpp
index 0f01c0f..0e15379 100644
--- a/WebCore/page/FrameTree.cpp
+++ b/WebCore/page/FrameTree.cpp
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
  * Copyright (C) 2006 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -40,6 +41,7 @@ FrameTree::~FrameTree()
 
 void FrameTree::setName(const AtomicString& name) 
 {
+    m_name = name;
     if (!parent()) {
         m_uniqueName = name;
         return;
@@ -50,6 +52,7 @@ void FrameTree::setName(const AtomicString& name)
 
 void FrameTree::clearName()
 {
+    m_name = AtomicString();
     m_uniqueName = AtomicString();
 }
 
diff --git a/WebCore/page/FrameTree.h b/WebCore/page/FrameTree.h
index 6a43075..58b7c1f 100644
--- a/WebCore/page/FrameTree.h
+++ b/WebCore/page/FrameTree.h
@@ -38,6 +38,7 @@ namespace WebCore {
         }
         ~FrameTree();
 
+        const AtomicString& name() const { return m_name; }
         const AtomicString& uniqueName() const { return m_uniqueName; }
         void setName(const AtomicString&);
         void clearName();
@@ -73,6 +74,7 @@ namespace WebCore {
         Frame* m_thisFrame;
 
         Frame* m_parent;
+        AtomicString m_name; // The actual frame name (may be empty).
         AtomicString m_uniqueName;
 
         // FIXME: use ListRefPtr?

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list