https://bugs.webkit.org/show_bug.cgi?id=83835
Reviewed by Ryosuke Niwa.
Before this patch, window.open called FrameTree::find and
Document::canNavigate separately. This patch refactors the code to
call FrameLoader::findFrameForNavigation, which does both. This
refactoring prepares window.open to understand seamless navigation,
which will happen in findFrameForNavigation.
This patch should have no behavior change today, but once we merge the
seamless branch, this change will be tested by
https://github.com/eseidel/webkit/blob/seamless/LayoutTests/fast/frames/seamless/seamless-window-open.html
See https://github.com/eseidel/webkit/commit/
a0d8b7defbb63047912aefbc8e22bca4f0638c37 for context.
* WebCore.exp.in:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::findFrameForNavigation):
(WebCore::createWindow):
* loader/FrameLoader.h:
(FrameLoader):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114057
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-12 Adam Barth <abarth@webkit.org>
+
+ window.open should prepare for seamless navigation by using findFrameForNavigation
+ https://bugs.webkit.org/show_bug.cgi?id=83835
+
+ Reviewed by Ryosuke Niwa.
+
+ Before this patch, window.open called FrameTree::find and
+ Document::canNavigate separately. This patch refactors the code to
+ call FrameLoader::findFrameForNavigation, which does both. This
+ refactoring prepares window.open to understand seamless navigation,
+ which will happen in findFrameForNavigation.
+
+ This patch should have no behavior change today, but once we merge the
+ seamless branch, this change will be tested by
+ https://github.com/eseidel/webkit/blob/seamless/LayoutTests/fast/frames/seamless/seamless-window-open.html
+
+ See https://github.com/eseidel/webkit/commit/a0d8b7defbb63047912aefbc8e22bca4f0638c37 for context.
+
+ * WebCore.exp.in:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::findFrameForNavigation):
+ (WebCore::createWindow):
+ * loader/FrameLoader.h:
+ (FrameLoader):
+
2012-04-12 Andy Estes <aestes@apple.com>
REGRESSION (r102262): iAd Producer relies on CSSStyleDeclaration property setters respecting '!important'
__ZN7WebCore11FrameLoader16loadFrameRequestERKNS_16FrameLoadRequestEbbN3WTF10PassRefPtrINS_5EventEEENS5_INS_9FormStateEEENS_18ShouldSendReferrerE
__ZN7WebCore11FrameLoader17stopForUserCancelEb
__ZN7WebCore11FrameLoader21loadURLIntoChildFrameERKNS_4KURLERKN3WTF6StringEPNS_5FrameE
-__ZN7WebCore11FrameLoader22findFrameForNavigationERKN3WTF12AtomicStringE
+__ZN7WebCore11FrameLoader22findFrameForNavigationERKN3WTF12AtomicStringEPNS_8DocumentE
__ZN7WebCore11FrameLoader23timeOfLastCompletedLoadEv
__ZN7WebCore11FrameLoader26reloadWithOverrideEncodingERKN3WTF6StringE
__ZN7WebCore11FrameLoader32setOriginalURLForDownloadRequestERNS_15ResourceRequestE
}
}
-Frame* FrameLoader::findFrameForNavigation(const AtomicString& name)
+Frame* FrameLoader::findFrameForNavigation(const AtomicString& name, Document* activeDocument)
{
Frame* frame = m_frame->tree()->find(name);
- // FIXME: We calling canNavigate on the Document that's requesting the
- // navigation, not based on the document that happens to be displayed in
- // this Frame.
- if (!m_frame->document()->canNavigate(frame))
- return 0;
+
+ if (activeDocument) {
+ if (!activeDocument->canNavigate(frame))
+ return 0;
+ } else {
+ // FIXME: Eventually all callers should supply the actual activeDocument
+ // so we can call canNavigate with the right document.
+ if (!m_frame->document()->canNavigate(frame))
+ return 0;
+ }
+
return frame;
}
ASSERT(!features.dialog || request.frameName().isEmpty());
if (!request.frameName().isEmpty() && request.frameName() != "_blank") {
- Frame* frame = lookupFrame->tree()->find(request.frameName());
- if (frame && openerFrame->document()->canNavigate(frame)) {
+ if (Frame* frame = lookupFrame->loader()->findFrameForNavigation(request.frameName(), openerFrame->document())) {
if (Page* page = frame->page())
page->chrome()->focus();
created = false;
FrameLoaderStateMachine* stateMachine() const { return &m_stateMachine; }
- Frame* findFrameForNavigation(const AtomicString& name);
+ Frame* findFrameForNavigation(const AtomicString& name, Document* activeDocument = 0);
void applyUserAgent(ResourceRequest&);