[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:18:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cad5323c137fb82cd75e4dfb2773b1d92314bdd7
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 30 03:49:02 2010 +0000

    2010-10-29  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
    
            Modified Chromium-port to use FrameTree::uniqueName().
    
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::name):
    2010-10-29  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
    
            Modified Qt-port to use FrameTree::uniqueName().
    
            * Api/qwebframe.cpp:
            (QWebFrame::frameName):
    2010-10-29  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
    
            Modified GTK-port to use FrameTree::uniqueName().
    
            * webkit/webkitwebframe.cpp:
            (webkit_web_frame_get_name):
    2010-10-29  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
    
            Modified Apple Windows-port to use FrameTree::uniqueName().
    
            * WebFrame.cpp:
            (WebFrame::name):
    2010-10-29  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
    
            Modified Mac-port to use FrameTree::uniqueName().
    
            * WebView/WebFrame.mm:
            (-[WebFrame name]):
    2010-10-29  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
    
            Modified EFL-port to use FrameTree::uniqueName().
    
            * ewk/ewk_frame.cpp:
            (ewk_frame_name_get):
    2010-10-29  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
    
            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.
            * html/HTMLFrameElementBase.h:
            * loader/DocumentLoader.cpp:
            (WebCore::DocumentLoader::mainResource): Use FrameTree::uniqueName().
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto.
            (WebCore::FrameLoader::commitProvisionalLoad): Ditto.
            * loader/HistoryController.cpp:
            (WebCore::HistoryController::saveDocumentState): Ditto.
            (WebCore::HistoryController::restoreDocumentState): Ditto.
            (WebCore::HistoryController::createItem):
            (WebCore::HistoryController::currentFramesMatchItem): Ditto.
            * loader/ProgressTracker.cpp:
            (WebCore::ProgressTracker::progressStarted): Ditto.
            (WebCore::ProgressTracker::progressCompleted): Ditto.
            * loader/archive/cf/LegacyWebArchive.cpp:
            (WebCore::LegacyWebArchive::create): Ditto.
            * page/FrameTree.cpp:
            (WebCore::FrameTree::setName): Modified to store the DOM-specified
            name of the frame.
            (WebCore::FrameTree::clearName):
            (WebCore::FrameTree::uniqueChildName): Use FrameTree::uniqueName().
            (WebCore::FrameTree::child): Ditto.
            (WebCore::FrameTree::find): Ditto.
            * page/FrameTree.h:
            (WebCore::FrameTree::uniqueName): Added.
    2010-10-29  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
    
            Updated test case fast/frames/frame-element-name.html to check
            the value of window.name.
    
            * fast/frames/frame-element-name-expected.txt: Updated result.
            * fast/frames/iframe-set-inner-html-expected.txt: Removed; This test ensured
            that the generated name for an unnamed frames was unique by looking at the
            value of window.name. However, the generated name should not be exposed to
            web developers. Instead, window.name should return the empty string for
            an unnamed frame as implied by section 5.1.6 of the HTML5 spec. We should
            consider exposing a DRT method for obtaining the internal frame name (which
            may be generated) and re-implementing this test to use it.
            * fast/frames/iframe-set-inner-html.html: Removed.
            * fast/frames/resources/frame-element-name-left.html: Added test for window.name.
            * fast/frames/resources/frame-element-name-right.html: Ditto.
    2010-10-29  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
    
            Modified WebKit2 to use FrameTree::uniqueName().
    
            * WebProcess/WebPage/WebFrame.cpp:
            (WebKit::WebFrame::name):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70971 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d8bb8c3..459fe2e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2010-10-29  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
+
+        Updated test case fast/frames/frame-element-name.html to check
+        the value of window.name.
+
+        * fast/frames/frame-element-name-expected.txt: Updated result.
+        * fast/frames/iframe-set-inner-html-expected.txt: Removed; This test ensured
+        that the generated name for an unnamed frames was unique by looking at the
+        value of window.name. However, the generated name should not be exposed to
+        web developers. Instead, window.name should return the empty string for
+        an unnamed frame as implied by section 5.1.6 of the HTML5 spec. We should
+        consider exposing a DRT method for obtaining the internal frame name (which
+        may be generated) and re-implementing this test to use it.
+        * fast/frames/iframe-set-inner-html.html: Removed.
+        * fast/frames/resources/frame-element-name-left.html: Added test for window.name.
+        * fast/frames/resources/frame-element-name-right.html: Ditto.
+
 2010-10-29  James Robinson  <jamesr at chromium.org>
 
         Update pixel expectations for Snow Leopard for tests in tables/mozilla/bugs.
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
deleted file mode 100644
index 63dd172..0000000
--- a/LayoutTests/fast/frames/iframe-set-inner-html-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-This tests that inserting two <iframe> elements using innerHTML actually causes two frames with unique names to be created.
-SUCCESS
diff --git a/LayoutTests/fast/frames/iframe-set-inner-html.html b/LayoutTests/fast/frames/iframe-set-inner-html.html
deleted file mode 100644
index e8cded4..0000000
--- a/LayoutTests/fast/frames/iframe-set-inner-html.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<html>
-<script>
-function runTest() {
-    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;
-    }
-    
-    if (window.frames[0].name == window.frames[1].name) {
-        r.innerHTML = 'FAILURE - both windows had tne same name'
-        return;
-    }
-    
-    r.innerHTML = 'SUCCESS';
-}
-</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/WebCore/ChangeLog b/WebCore/ChangeLog
index 8dbc332..ad4c666 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,48 @@
+2010-10-29  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
+
+        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.
+        * html/HTMLFrameElementBase.h:
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::mainResource): Use FrameTree::uniqueName().
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto.
+        (WebCore::FrameLoader::commitProvisionalLoad): Ditto.
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::saveDocumentState): Ditto.
+        (WebCore::HistoryController::restoreDocumentState): Ditto.
+        (WebCore::HistoryController::createItem):
+        (WebCore::HistoryController::currentFramesMatchItem): Ditto.
+        * loader/ProgressTracker.cpp:
+        (WebCore::ProgressTracker::progressStarted): Ditto.
+        (WebCore::ProgressTracker::progressCompleted): Ditto.
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::create): Ditto.
+        * page/FrameTree.cpp:
+        (WebCore::FrameTree::setName): Modified to store the DOM-specified
+        name of the frame.
+        (WebCore::FrameTree::clearName):
+        (WebCore::FrameTree::uniqueChildName): Use FrameTree::uniqueName().
+        (WebCore::FrameTree::child): Ditto.
+        (WebCore::FrameTree::find): Ditto.
+        * page/FrameTree.h:
+        (WebCore::FrameTree::uniqueName): Added.
+
 2010-10-29  Darin Adler  <darin at apple.com>
 
         Try to fix build.
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/html/HTMLFrameElementBase.h b/WebCore/html/HTMLFrameElementBase.h
index ef25f30..2a363c2 100644
--- a/WebCore/html/HTMLFrameElementBase.h
+++ b/WebCore/html/HTMLFrameElementBase.h
@@ -71,7 +71,7 @@ private:
     void openURL(bool lockHistory = true, bool lockBackForwardList = true);
 
     AtomicString m_URL;
-    AtomicString m_frameName;
+    AtomicString m_frameName; // The actual frame name (may be empty).
 
     ScrollbarMode m_scrolling;
 
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index 30b80eb..19a55ef 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -491,7 +491,7 @@ PassRefPtr<ArchiveResource> DocumentLoader::mainResource() const
     if (!mainResourceBuffer)
         mainResourceBuffer = SharedBuffer::create();
         
-    return ArchiveResource::create(mainResourceBuffer, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree()->name());
+    return ArchiveResource::create(mainResourceBuffer, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree()->uniqueName());
 }
 
 PassRefPtr<ArchiveResource> DocumentLoader::subresource(const KURL& url) const
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index b90b18c..3322069 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -928,7 +928,7 @@ void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
     // If we're moving in the back/forward list, we might want to replace the content
     // of this child frame with whatever was there at that point.
     if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType)) {
-        HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree()->name());
+        HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree()->uniqueName());
         if (childItem) {
             // Use the original URL to ensure we get all the side-effects, such as
             // onLoad handlers, of any redirects that happened. An example of where
@@ -939,7 +939,7 @@ void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
         }
     }
 
-    RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree()->name());
+    RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree()->uniqueName());
     
     if (subframeArchive)
         childFrame->loader()->loadArchive(subframeArchive.release());
@@ -1832,7 +1832,7 @@ void FrameLoader::commitProvisionalLoad()
     RefPtr<CachedPage> cachedPage = m_loadingFromCachedPage ? pageCache()->get(history()->provisionalItem()) : 0;
     RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
 
-    LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame->tree()->name().string().utf8().data(), m_URL.string().utf8().data(), 
+    LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame->tree()->uniqueName().string().utf8().data(), m_URL.string().utf8().data(), 
         pdl ? pdl->url().string().utf8().data() : "<no provisional DocumentLoader>");
 
     // Check to see if we need to cache the page we are navigating away from into the back/forward cache.
@@ -1880,7 +1880,7 @@ void FrameLoader::commitProvisionalLoad()
         didOpenURL(url);
     }
 
-    LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->name().string().utf8().data(), m_URL.string().utf8().data());
+    LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->uniqueName().string().utf8().data(), m_URL.string().utf8().data());
 
     if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect())
         history()->updateForClientRedirect();
diff --git a/WebCore/loader/HistoryController.cpp b/WebCore/loader/HistoryController.cpp
index 31f4889..07bece7 100644
--- a/WebCore/loader/HistoryController.cpp
+++ b/WebCore/loader/HistoryController.cpp
@@ -149,7 +149,7 @@ void HistoryController::saveDocumentState()
     ASSERT(document);
     
     if (item->isCurrentDocument(document)) {
-        LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()->name().string().utf8().data(), item);
+        LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()->uniqueName().string().utf8().data(), item);
         item->setDocumentState(document->formElementsState());
     }
 }
@@ -188,7 +188,7 @@ void HistoryController::restoreDocumentState()
     if (!itemToRestore)
         return;
 
-    LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame->tree()->name().string().utf8().data(), itemToRestore);
+    LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame->tree()->uniqueName().string().utf8().data(), itemToRestore);
     doc->setStateForNewFormElements(itemToRestore->documentState());
 }
 
@@ -480,10 +480,10 @@ PassRefPtr<HistoryItem> HistoryController::createItem(bool useOriginal)
         originalURL = blankURL();
     
     Frame* parentFrame = m_frame->tree()->parent();
-    String parent = parentFrame ? parentFrame->tree()->name() : "";
+    String parent = parentFrame ? parentFrame->tree()->uniqueName() : "";
     String title = documentLoader ? documentLoader->title() : "";
 
-    RefPtr<HistoryItem> item = HistoryItem::create(url, m_frame->tree()->name(), parent, title);
+    RefPtr<HistoryItem> item = HistoryItem::create(url, m_frame->tree()->uniqueName(), parent, title);
     item->setOriginalURLString(originalURL.string());
 
     if (!unreachableURL.isEmpty() || !documentLoader || documentLoader->response().httpStatusCode() >= 400)
@@ -598,7 +598,7 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt
 // Helper method that determines whether the current frame tree matches given history item's.
 bool HistoryController::currentFramesMatchItem(HistoryItem* item) const
 {
-    if ((!m_frame->tree()->name().isEmpty() || !item->target().isEmpty()) && m_frame->tree()->name() != item->target())
+    if ((!m_frame->tree()->uniqueName().isEmpty() || !item->target().isEmpty()) && m_frame->tree()->uniqueName() != item->target())
         return false;
         
     const HistoryItemVector& childItems = item->children();
diff --git a/WebCore/loader/ProgressTracker.cpp b/WebCore/loader/ProgressTracker.cpp
index 561e6bc..6bc2055 100644
--- a/WebCore/loader/ProgressTracker.cpp
+++ b/WebCore/loader/ProgressTracker.cpp
@@ -101,7 +101,7 @@ void ProgressTracker::reset()
 
 void ProgressTracker::progressStarted(Frame* frame)
 {
-    LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree()->name().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree()->uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
 
     frame->loader()->client()->willChangeEstimatedProgress();
     
@@ -119,7 +119,7 @@ void ProgressTracker::progressStarted(Frame* frame)
 
 void ProgressTracker::progressCompleted(Frame* frame)
 {
-    LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree()->name().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree()->uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
     
     if (m_numProgressTrackedFrames <= 0)
         return;
diff --git a/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/WebCore/loader/archive/cf/LegacyWebArchive.cpp
index 061f4d9..3efea91 100644
--- a/WebCore/loader/archive/cf/LegacyWebArchive.cpp
+++ b/WebCore/loader/archive/cf/LegacyWebArchive.cpp
@@ -492,7 +492,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
     if (responseURL.isNull())
         responseURL = KURL(ParsedURLString, "");
         
-    PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()->name());
+    PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()->uniqueName());
 
     Vector<PassRefPtr<LegacyWebArchive> > subframeArchives;
     Vector<PassRefPtr<ArchiveResource> > subresources;
@@ -509,7 +509,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
             if (subframeArchive)
                 subframeArchives.append(subframeArchive);
             else
-                LOG_ERROR("Unabled to archive subframe %s", childFrame->tree()->name().string().utf8().data());
+                LOG_ERROR("Unabled to archive subframe %s", childFrame->tree()->uniqueName().string().utf8().data());
         } else {
             ListHashSet<KURL> subresourceURLs;
             node->getSubresourceURLs(subresourceURLs);
diff --git a/WebCore/page/FrameTree.cpp b/WebCore/page/FrameTree.cpp
index 1f0604c..ab3896d 100644
--- a/WebCore/page/FrameTree.cpp
+++ b/WebCore/page/FrameTree.cpp
@@ -40,17 +40,19 @@ FrameTree::~FrameTree()
 
 void FrameTree::setName(const AtomicString& name) 
 {
+    m_name = name;
     if (!parent()) {
-        m_name = name;
+        m_uniqueName = name;
         return;
     }
-    m_name = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.
-    m_name = parent()->tree()->uniqueChildName(name);
+    m_uniqueName = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.
+    m_uniqueName = parent()->tree()->uniqueChildName(name);
 }
 
 void FrameTree::clearName()
 {
     m_name = AtomicString();
+    m_uniqueName = AtomicString();
 }
 
 Frame* FrameTree::parent(bool checkForDisconnectedFrame) const 
@@ -119,19 +121,19 @@ AtomicString FrameTree::uniqueChildName(const AtomicString& requestedName) const
     Vector<Frame*, 16> chain;
     Frame* frame;
     for (frame = m_thisFrame; frame; frame = frame->tree()->parent()) {
-        if (frame->tree()->name().startsWith(framePathPrefix))
+        if (frame->tree()->uniqueName().startsWith(framePathPrefix))
             break;
         chain.append(frame);
     }
     String name;
     name += framePathPrefix;
     if (frame)
-        name += frame->tree()->name().string().substring(framePathPrefixLength,
-            frame->tree()->name().length() - framePathPrefixLength - framePathSuffixLength);
+        name += frame->tree()->uniqueName().string().substring(framePathPrefixLength,
+            frame->tree()->uniqueName().length() - framePathPrefixLength - framePathSuffixLength);
     for (int i = chain.size() - 1; i >= 0; --i) {
         frame = chain[i];
         name += "/";
-        name += frame->tree()->name();
+        name += frame->tree()->uniqueName();
     }
 
     // Suffix buffer has more than enough space for:
@@ -159,7 +161,7 @@ Frame* FrameTree::child(unsigned index) const
 Frame* FrameTree::child(const AtomicString& name) const
 {
     for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
-        if (child->tree()->name() == name)
+        if (child->tree()->uniqueName() == name)
             return child;
     return 0;
 }
@@ -181,7 +183,7 @@ Frame* FrameTree::find(const AtomicString& name) const
 
     // Search subtree starting with this frame first.
     for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->traverseNext(m_thisFrame))
-        if (frame->tree()->name() == name)
+        if (frame->tree()->uniqueName() == name)
             return frame;
 
     // Search the entire tree for this page next.
@@ -192,7 +194,7 @@ Frame* FrameTree::find(const AtomicString& name) const
         return 0;
 
     for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
-        if (frame->tree()->name() == name)
+        if (frame->tree()->uniqueName() == name)
             return frame;
 
     // Search the entire tree of each of the other pages in this namespace.
@@ -203,7 +205,7 @@ Frame* FrameTree::find(const AtomicString& name) const
         Page* otherPage = *it;
         if (otherPage != page) {
             for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
-                if (frame->tree()->name() == name)
+                if (frame->tree()->uniqueName() == name)
                     return frame;
             }
         }
diff --git a/WebCore/page/FrameTree.h b/WebCore/page/FrameTree.h
index b97aab6..58b7c1f 100644
--- a/WebCore/page/FrameTree.h
+++ b/WebCore/page/FrameTree.h
@@ -39,6 +39,7 @@ namespace WebCore {
         ~FrameTree();
 
         const AtomicString& name() const { return m_name; }
+        const AtomicString& uniqueName() const { return m_uniqueName; }
         void setName(const AtomicString&);
         void clearName();
         Frame* parent(bool checkForDisconnectedFrame = false) const;
@@ -73,7 +74,8 @@ namespace WebCore {
         Frame* m_thisFrame;
 
         Frame* m_parent;
-        AtomicString m_name;
+        AtomicString m_name; // The actual frame name (may be empty).
+        AtomicString m_uniqueName;
 
         // FIXME: use ListRefPtr?
         RefPtr<Frame> m_nextSibling;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 791682e..c7a2fbc 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified Chromium-port to use FrameTree::uniqueName().
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::name):
+
 2010-10-29  Kavita Kanetkar  <kkanetkar at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index b4d23c0..61afafa 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -486,7 +486,7 @@ WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element)
 
 WebString WebFrameImpl::name() const
 {
-    return m_frame->tree()->name();
+    return m_frame->tree()->uniqueName();
 }
 
 void WebFrameImpl::setName(const WebString& name)
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index bf9af1e..f08fc74 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified EFL-port to use FrameTree::uniqueName().
+
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_name_get):
+
 2010-10-29  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
index 1395fa5..7cf1b0f 100644
--- a/WebKit/efl/ewk/ewk_frame.cpp
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -474,7 +474,7 @@ const char* ewk_frame_name_get(const Evas_Object* o)
         return 0;
     }
 
-    WTF::String s = sd->frame->tree()->name();
+    WTF::String s = sd->frame->tree()->uniqueName();
     WTF::CString cs = s.utf8();
     sd->name = eina_stringshare_add_length(cs.data(), cs.length());
     return sd->name;
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index e7983ca..0b0ec3e 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified GTK-port to use FrameTree::uniqueName().
+
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_get_name):
+
 2010-10-29  Martin Robinson  <mrobinson at igalia.com>
 
         Build fix for GTK+ after BackForwardListImpl introduction.
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index c581ce6..20fde35 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -480,7 +480,7 @@ G_CONST_RETURN gchar* webkit_web_frame_get_name(WebKitWebFrame* frame)
     if (!coreFrame)
         return "";
 
-    String string = coreFrame->tree()->name();
+    String string = coreFrame->tree()->uniqueName();
     priv->name = g_strdup(string.utf8().data());
     return priv->name;
 }
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index e7abf3d..0fe97a6 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified Mac-port to use FrameTree::uniqueName().
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame name]):
+
 2010-10-29  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 4f8c1ba..66a6454 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1406,7 +1406,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     Frame* coreFrame = _private->coreFrame;
     if (!coreFrame)
         return nil;
-    return coreFrame->tree()->name();
+    return coreFrame->tree()->uniqueName();
 }
 
 - (WebFrameView *)frameView
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 39e74d9..050699b 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -758,7 +758,7 @@ QIcon QWebFrame::icon() const
 */
 QString QWebFrame::frameName() const
 {
-    return d->frame->tree()->name();
+    return d->frame->tree()->uniqueName();
 }
 
 /*!
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 98d6d45..d1f8d29 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified Qt-port to use FrameTree::uniqueName().
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::frameName):
+
 2010-10-29  Andreas Kling  <kling at webkit.org>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index fb8f19e..25753e2 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified Apple Windows-port to use FrameTree::uniqueName().
+
+        * WebFrame.cpp:
+        (WebFrame::name):
+
 2010-10-29  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 9db6a2a..a6b477d 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -438,7 +438,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::name(
     if (!coreFrame)
         return E_FAIL;
 
-    *frameName = BString(coreFrame->tree()->name()).release();
+    *frameName = BString(coreFrame->tree()->uniqueName()).release();
     return S_OK;
 }
 
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2074d6f..978b55f 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-29  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
+
+        Modified WebKit2 to use FrameTree::uniqueName().
+
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::name):
+
 2010-10-29  Sam Weinig  <weinig at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.cpp b/WebKit2/WebProcess/WebPage/WebFrame.cpp
index 4dbdec3..b4b2fe2 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -247,7 +247,7 @@ String WebFrame::name() const
     if (!m_coreFrame)
         return String();
 
-    return m_coreFrame->tree()->name();
+    return m_coreFrame->tree()->uniqueName();
 }
 
 String WebFrame::url() const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list