diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/WebCore/loader/FrameLoader.cpp | |
parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/loader/FrameLoader.cpp')
-rw-r--r-- | Source/WebCore/loader/FrameLoader.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp index cc5696cdc..437a1f616 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp @@ -68,6 +68,7 @@ #include "FrameView.h" #include "HTMLAnchorElement.h" #include "HTMLFormElement.h" +#include "HTMLInputElement.h" #include "HTMLNames.h" #include "HTMLObjectElement.h" #include "HTMLParserIdioms.h" @@ -89,7 +90,6 @@ #include "ResourceRequest.h" #include "SchemeRegistry.h" #include "ScriptCallStack.h" -#include "ScriptCallStackFactory.h" #include "ScriptController.h" #include "ScriptSourceCode.h" #include "ScrollAnimator.h" @@ -399,8 +399,8 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy) if (m_frame->document()) { if (m_didCallImplicitClose && !m_wasUnloadEventEmitted) { Node* currentFocusedNode = m_frame->document()->focusedNode(); - if (currentFocusedNode) - currentFocusedNode->aboutToUnload(); + if (currentFocusedNode && currentFocusedNode->toInputElement()) + currentFocusedNode->toInputElement()->endEditing(); if (m_pageDismissalEventBeingDispatched == NoDismissal) { if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) { m_pageDismissalEventBeingDispatched = PageHideDismissal; @@ -570,7 +570,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool m_frame->script()->clearWindowShell(newDocument->domWindow(), m_frame->document()->inPageCache()); } - m_frame->selection()->clear(); + m_frame->selection()->prepareForDestruction(); m_frame->eventHandler()->clear(); if (clearFrameView && m_frame->view()) m_frame->view()->clear(); @@ -1671,6 +1671,7 @@ void FrameLoader::commitProvisionalLoad() { RefPtr<CachedPage> cachedPage = m_loadingFromCachedPage ? pageCache()->get(history()->provisionalItem()) : 0; RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; + RefPtr<Frame> protect(m_frame); 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_frame->document() ? m_frame->document()->url().string().utf8().data() : "", @@ -3321,21 +3322,25 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque page->chrome()->setResizable(features.resizable); // 'x' and 'y' specify the location of the window, while 'width' and 'height' - // specify the size of the page. We can only resize the window, so - // adjust for the difference between the window size and the page size. + // specify the size of the viewport. We can only resize the window, so adjust + // for the difference between the window size and the viewport size. FloatRect windowRect = page->chrome()->windowRect(); - FloatSize pageSize = page->chrome()->pageRect().size(); + FloatSize viewportSize = page->chrome()->pageRect().size(); + if (features.xSet) windowRect.setX(features.x); if (features.ySet) windowRect.setY(features.y); if (features.widthSet) - windowRect.setWidth(features.width + (windowRect.width() - pageSize.width())); + windowRect.setWidth(features.width + (windowRect.width() - viewportSize.width())); if (features.heightSet) - windowRect.setHeight(features.height + (windowRect.height() - pageSize.height())); - page->chrome()->setWindowRect(windowRect); + windowRect.setHeight(features.height + (windowRect.height() - viewportSize.height())); + + // Ensure non-NaN values, minimum size as well as being within valid screen area. + FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); + page->chrome()->setWindowRect(newWindowRect); page->chrome()->show(); created = true; |