Changeset 70971 in webkit
- Timestamp:
- Oct 29, 2010 8:49:02 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70967 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Updated test case fast/frames/frame-element-name.html to check 9 the value of window.name. 10 11 * fast/frames/frame-element-name-expected.txt: Updated result. 12 * fast/frames/iframe-set-inner-html-expected.txt: Removed; This test ensured 13 that the generated name for an unnamed frames was unique by looking at the 14 value of window.name. However, the generated name should not be exposed to 15 web developers. Instead, window.name should return the empty string for 16 an unnamed frame as implied by section 5.1.6 of the HTML5 spec. We should 17 consider exposing a DRT method for obtaining the internal frame name (which 18 may be generated) and re-implementing this test to use it. 19 * fast/frames/iframe-set-inner-html.html: Removed. 20 * fast/frames/resources/frame-element-name-left.html: Added test for window.name. 21 * fast/frames/resources/frame-element-name-right.html: Ditto. 22 1 23 2010-10-29 James Robinson <jamesr@chromium.org> 2 24 -
trunk/LayoutTests/fast/frames/frame-element-name-expected.txt
r70185 r70971 5 5 -------- 6 6 PASS escape(window.frameElement.name) is "left" 7 PASS escape(window.name) is "left" 7 8 8 9 … … 11 12 -------- 12 13 PASS escape(window.frameElement.name) is "" 14 PASS escape(window.name) is "" 13 15 -
trunk/LayoutTests/fast/frames/resources/frame-element-name-left.html
r70185 r70971 8 8 <script> 9 9 shouldBeEqualToString("escape(window.frameElement.name)", "left"); 10 shouldBeEqualToString("escape(window.name)", "left"); 10 11 </script> 11 12 </body> -
trunk/LayoutTests/fast/frames/resources/frame-element-name-right.html
r70185 r70971 8 8 <script> 9 9 shouldBeEqualToString("escape(window.frameElement.name)", ""); 10 shouldBeEqualToString("escape(window.name)", ""); 10 11 </script> 11 12 </body> -
trunk/WebCore/ChangeLog
r70963 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Fixes an issue where the window.name of an unnamed frame returns 9 a unique generated name that is used internally to identify the 10 frame. Instead, we should return an empty string as implied by 11 section 5.1.6 of the HTML5 spec. (http://www.w3.org/TR/html5/browsers.html#browsing-context-names). 12 This section describes that a browsing context can have no name or be 13 the empty string. 14 15 * html/HTMLFrameElementBase.cpp: 16 (WebCore::HTMLFrameElementBase::openURL): Removed ASSERT for empty 17 frame name since this is valid as per the HTML5 spec. 18 (WebCore::HTMLFrameElementBase::setName): Removed the call to FrameTree::uniqueChildName() 19 since the loader code no longer depends on the frame name being unique. 20 * html/HTMLFrameElementBase.h: 21 * loader/DocumentLoader.cpp: 22 (WebCore::DocumentLoader::mainResource): Use FrameTree::uniqueName(). 23 * loader/FrameLoader.cpp: 24 (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto. 25 (WebCore::FrameLoader::commitProvisionalLoad): Ditto. 26 * loader/HistoryController.cpp: 27 (WebCore::HistoryController::saveDocumentState): Ditto. 28 (WebCore::HistoryController::restoreDocumentState): Ditto. 29 (WebCore::HistoryController::createItem): 30 (WebCore::HistoryController::currentFramesMatchItem): Ditto. 31 * loader/ProgressTracker.cpp: 32 (WebCore::ProgressTracker::progressStarted): Ditto. 33 (WebCore::ProgressTracker::progressCompleted): Ditto. 34 * loader/archive/cf/LegacyWebArchive.cpp: 35 (WebCore::LegacyWebArchive::create): Ditto. 36 * page/FrameTree.cpp: 37 (WebCore::FrameTree::setName): Modified to store the DOM-specified 38 name of the frame. 39 (WebCore::FrameTree::clearName): 40 (WebCore::FrameTree::uniqueChildName): Use FrameTree::uniqueName(). 41 (WebCore::FrameTree::child): Ditto. 42 (WebCore::FrameTree::find): Ditto. 43 * page/FrameTree.h: 44 (WebCore::FrameTree::uniqueName): Added. 45 1 46 2010-10-29 Darin Adler <darin@apple.com> 2 47 -
trunk/WebCore/html/HTMLFrameElementBase.cpp
r70407 r70971 93 93 void HTMLFrameElementBase::openURL(bool lockHistory, bool lockBackForwardList) 94 94 { 95 ASSERT(!m_frameName.isEmpty());96 97 95 if (!isURLAllowed()) 98 96 return; … … 156 154 if (m_frameName.isNull()) 157 155 m_frameName = getIdAttribute(); 158 159 if (Frame* parentFrame = document()->frame())160 m_frameName = parentFrame->tree()->uniqueChildName(m_frameName);161 156 } 162 157 -
trunk/WebCore/html/HTMLFrameElementBase.h
r70407 r70971 72 72 73 73 AtomicString m_URL; 74 AtomicString m_frameName; 74 AtomicString m_frameName; // The actual frame name (may be empty). 75 75 76 76 ScrollbarMode m_scrolling; -
trunk/WebCore/loader/DocumentLoader.cpp
r70574 r70971 492 492 mainResourceBuffer = SharedBuffer::create(); 493 493 494 return ArchiveResource::create(mainResourceBuffer, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree()-> name());494 return ArchiveResource::create(mainResourceBuffer, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree()->uniqueName()); 495 495 } 496 496 -
trunk/WebCore/loader/FrameLoader.cpp
r70960 r70971 929 929 // of this child frame with whatever was there at that point. 930 930 if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType)) { 931 HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree()-> name());931 HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree()->uniqueName()); 932 932 if (childItem) { 933 933 // Use the original URL to ensure we get all the side-effects, such as … … 940 940 } 941 941 942 RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree()-> name());942 RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree()->uniqueName()); 943 943 944 944 if (subframeArchive) … … 1833 1833 RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; 1834 1834 1835 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(),1835 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(), 1836 1836 pdl ? pdl->url().string().utf8().data() : "<no provisional DocumentLoader>"); 1837 1837 … … 1881 1881 } 1882 1882 1883 LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()-> name().string().utf8().data(), m_URL.string().utf8().data());1883 LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->uniqueName().string().utf8().data(), m_URL.string().utf8().data()); 1884 1884 1885 1885 if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect()) -
trunk/WebCore/loader/HistoryController.cpp
r70960 r70971 150 150 151 151 if (item->isCurrentDocument(document)) { 152 LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()-> name().string().utf8().data(), item);152 LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()->uniqueName().string().utf8().data(), item); 153 153 item->setDocumentState(document->formElementsState()); 154 154 } … … 189 189 return; 190 190 191 LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame->tree()-> name().string().utf8().data(), itemToRestore);191 LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame->tree()->uniqueName().string().utf8().data(), itemToRestore); 192 192 doc->setStateForNewFormElements(itemToRestore->documentState()); 193 193 } … … 481 481 482 482 Frame* parentFrame = m_frame->tree()->parent(); 483 String parent = parentFrame ? parentFrame->tree()-> name() : "";483 String parent = parentFrame ? parentFrame->tree()->uniqueName() : ""; 484 484 String title = documentLoader ? documentLoader->title() : ""; 485 485 486 RefPtr<HistoryItem> item = HistoryItem::create(url, m_frame->tree()-> name(), parent, title);486 RefPtr<HistoryItem> item = HistoryItem::create(url, m_frame->tree()->uniqueName(), parent, title); 487 487 item->setOriginalURLString(originalURL.string()); 488 488 … … 599 599 bool HistoryController::currentFramesMatchItem(HistoryItem* item) const 600 600 { 601 if ((!m_frame->tree()-> name().isEmpty() || !item->target().isEmpty()) && m_frame->tree()->name() != item->target())601 if ((!m_frame->tree()->uniqueName().isEmpty() || !item->target().isEmpty()) && m_frame->tree()->uniqueName() != item->target()) 602 602 return false; 603 603 -
trunk/WebCore/loader/ProgressTracker.cpp
r69643 r70971 102 102 void ProgressTracker::progressStarted(Frame* frame) 103 103 { 104 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());104 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()); 105 105 106 106 frame->loader()->client()->willChangeEstimatedProgress(); … … 120 120 void ProgressTracker::progressCompleted(Frame* frame) 121 121 { 122 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());122 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()); 123 123 124 124 if (m_numProgressTrackedFrames <= 0) -
trunk/WebCore/loader/archive/cf/LegacyWebArchive.cpp
r69798 r70971 493 493 responseURL = KURL(ParsedURLString, ""); 494 494 495 PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()-> name());495 PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()->uniqueName()); 496 496 497 497 Vector<PassRefPtr<LegacyWebArchive> > subframeArchives; … … 510 510 subframeArchives.append(subframeArchive); 511 511 else 512 LOG_ERROR("Unabled to archive subframe %s", childFrame->tree()-> name().string().utf8().data());512 LOG_ERROR("Unabled to archive subframe %s", childFrame->tree()->uniqueName().string().utf8().data()); 513 513 } else { 514 514 ListHashSet<KURL> subresourceURLs; -
trunk/WebCore/page/FrameTree.cpp
r60287 r70971 41 41 void FrameTree::setName(const AtomicString& name) 42 42 { 43 m_name = name; 43 44 if (!parent()) { 44 m_ name = name;45 m_uniqueName = name; 45 46 return; 46 47 } 47 m_ name = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.48 m_ name = parent()->tree()->uniqueChildName(name);48 m_uniqueName = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName. 49 m_uniqueName = parent()->tree()->uniqueChildName(name); 49 50 } 50 51 … … 52 53 { 53 54 m_name = AtomicString(); 55 m_uniqueName = AtomicString(); 54 56 } 55 57 … … 120 122 Frame* frame; 121 123 for (frame = m_thisFrame; frame; frame = frame->tree()->parent()) { 122 if (frame->tree()-> name().startsWith(framePathPrefix))124 if (frame->tree()->uniqueName().startsWith(framePathPrefix)) 123 125 break; 124 126 chain.append(frame); … … 127 129 name += framePathPrefix; 128 130 if (frame) 129 name += frame->tree()-> name().string().substring(framePathPrefixLength,130 frame->tree()-> name().length() - framePathPrefixLength - framePathSuffixLength);131 name += frame->tree()->uniqueName().string().substring(framePathPrefixLength, 132 frame->tree()->uniqueName().length() - framePathPrefixLength - framePathSuffixLength); 131 133 for (int i = chain.size() - 1; i >= 0; --i) { 132 134 frame = chain[i]; 133 135 name += "/"; 134 name += frame->tree()-> name();136 name += frame->tree()->uniqueName(); 135 137 } 136 138 … … 160 162 { 161 163 for (Frame* child = firstChild(); child; child = child->tree()->nextSibling()) 162 if (child->tree()-> name() == name)164 if (child->tree()->uniqueName() == name) 163 165 return child; 164 166 return 0; … … 182 184 // Search subtree starting with this frame first. 183 185 for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->traverseNext(m_thisFrame)) 184 if (frame->tree()-> name() == name)186 if (frame->tree()->uniqueName() == name) 185 187 return frame; 186 188 … … 193 195 194 196 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) 195 if (frame->tree()-> name() == name)197 if (frame->tree()->uniqueName() == name) 196 198 return frame; 197 199 … … 204 206 if (otherPage != page) { 205 207 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) { 206 if (frame->tree()-> name() == name)208 if (frame->tree()->uniqueName() == name) 207 209 return frame; 208 210 } -
trunk/WebCore/page/FrameTree.h
r65077 r70971 40 40 41 41 const AtomicString& name() const { return m_name; } 42 const AtomicString& uniqueName() const { return m_uniqueName; } 42 43 void setName(const AtomicString&); 43 44 void clearName(); … … 74 75 75 76 Frame* m_parent; 76 AtomicString m_name; 77 AtomicString m_name; // The actual frame name (may be empty). 78 AtomicString m_uniqueName; 77 79 78 80 // FIXME: use ListRefPtr? -
trunk/WebKit/chromium/ChangeLog
r70956 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified Chromium-port to use FrameTree::uniqueName(). 9 10 * src/WebFrameImpl.cpp: 11 (WebKit::WebFrameImpl::name): 12 1 13 2010-10-29 Kavita Kanetkar <kkanetkar@chromium.org> 2 14 -
trunk/WebKit/chromium/src/WebFrameImpl.cpp
r70463 r70971 487 487 WebString WebFrameImpl::name() const 488 488 { 489 return m_frame->tree()-> name();489 return m_frame->tree()->uniqueName(); 490 490 } 491 491 -
trunk/WebKit/efl/ChangeLog
r70931 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified EFL-port to use FrameTree::uniqueName(). 9 10 * ewk/ewk_frame.cpp: 11 (ewk_frame_name_get): 12 1 13 2010-10-29 Darin Adler <darin@apple.com> 2 14 -
trunk/WebKit/efl/ewk/ewk_frame.cpp
r68154 r70971 475 475 } 476 476 477 WTF::String s = sd->frame->tree()-> name();477 WTF::String s = sd->frame->tree()->uniqueName(); 478 478 WTF::CString cs = s.utf8(); 479 479 sd->name = eina_stringshare_add_length(cs.data(), cs.length()); -
trunk/WebKit/gtk/ChangeLog
r70955 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified GTK-port to use FrameTree::uniqueName(). 9 10 * webkit/webkitwebframe.cpp: 11 (webkit_web_frame_get_name): 12 1 13 2010-10-29 Martin Robinson <mrobinson@igalia.com> 2 14 -
trunk/WebKit/gtk/webkit/webkitwebframe.cpp
r68040 r70971 481 481 return ""; 482 482 483 String string = coreFrame->tree()-> name();483 String string = coreFrame->tree()->uniqueName(); 484 484 priv->name = g_strdup(string.utf8().data()); 485 485 return priv->name; -
trunk/WebKit/mac/ChangeLog
r70931 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified Mac-port to use FrameTree::uniqueName(). 9 10 * WebView/WebFrame.mm: 11 (-[WebFrame name]): 12 1 13 2010-10-29 Darin Adler <darin@apple.com> 2 14 -
trunk/WebKit/mac/WebView/WebFrame.mm
r70199 r70971 1407 1407 if (!coreFrame) 1408 1408 return nil; 1409 return coreFrame->tree()-> name();1409 return coreFrame->tree()->uniqueName(); 1410 1410 } 1411 1411 -
trunk/WebKit/qt/Api/qwebframe.cpp
r69851 r70971 759 759 QString QWebFrame::frameName() const 760 760 { 761 return d->frame->tree()-> name();761 return d->frame->tree()->uniqueName(); 762 762 } 763 763 -
trunk/WebKit/qt/ChangeLog
r70948 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified Qt-port to use FrameTree::uniqueName(). 9 10 * Api/qwebframe.cpp: 11 (QWebFrame::frameName): 12 1 13 2010-10-29 Andreas Kling <kling@webkit.org> 2 14 -
trunk/WebKit/win/ChangeLog
r70931 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified Apple Windows-port to use FrameTree::uniqueName(). 9 10 * WebFrame.cpp: 11 (WebFrame::name): 12 1 13 2010-10-29 Darin Adler <darin@apple.com> 2 14 -
trunk/WebKit/win/WebFrame.cpp
r70376 r70971 439 439 return E_FAIL; 440 440 441 *frameName = BString(coreFrame->tree()-> name()).release();441 *frameName = BString(coreFrame->tree()->uniqueName()).release(); 442 442 return S_OK; 443 443 } -
trunk/WebKit2/ChangeLog
r70966 r70971 1 2010-10-29 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Adam Barth. 4 5 For unnamed frames, window.name returns a generated name 6 https://bugs.webkit.org/show_bug.cgi?id=6751 7 8 Modified WebKit2 to use FrameTree::uniqueName(). 9 10 * WebProcess/WebPage/WebFrame.cpp: 11 (WebKit::WebFrame::name): 12 1 13 2010-10-29 Sam Weinig <weinig@apple.com> 2 14 -
trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp
r70936 r70971 248 248 return String(); 249 249 250 return m_coreFrame->tree()-> name();250 return m_coreFrame->tree()->uniqueName(); 251 251 } 252 252
Note: See TracChangeset
for help on using the changeset viewer.