- Revision
- 139341
- Author
- [email protected]
- Date
- 2013-01-10 10:44:48 -0800 (Thu, 10 Jan 2013)
Log Message
Ensure that WebPageProxy's notion of pageScaleFactor is reset on didCommitLoad
https://bugs.webkit.org/show_bug.cgi?id=103290
<rdar://problem/12752467>
Reviewed by Darin Adler.
When a standard main frame load is committed, we reset the WebPage's
pageScaleFactor, if it's not the default. However, if the previous
page had a full-main-frame plugin that was handling page scaling itself,
WebPageProxy can have a cached pageScaleFactor != 1, while WebPage
now (since the plugin that was overriding (set)pageScaleFactor is gone)
has a pageScaleFactor of 1, causing us to skip the call to reset the
WebPage's pageScaleFactor.
Therefore, when WebPageProxy is notified that a standard main-frame load
is committed, reset its cached notion of the pageScaleFactor.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame): Add a parameter which corresponds to FrameLoadType, so we can
determine whether a frame load is of FrameLoadTypeStandard (which matches the check to reset page scale in
WebFrameLoaderClient::didCommitLoad), so we can reset m_pageScaleFactor.
* UIProcess/WebPageProxy.h:
(WebPageProxy): Add frameLoadType parameter to didCommitLoadForFrame.
* UIProcess/WebPageProxy.messages.in: Add frameLoadType parameter to didCommitLoadForFrame.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): Pass frameLoadType parameter to didCommitLoadForFrame.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (139340 => 139341)
--- trunk/Source/WebKit2/ChangeLog 2013-01-10 18:42:07 UTC (rev 139340)
+++ trunk/Source/WebKit2/ChangeLog 2013-01-10 18:44:48 UTC (rev 139341)
@@ -1,5 +1,34 @@
2013-01-10 Tim Horton <[email protected]>
+ Ensure that WebPageProxy's notion of pageScaleFactor is reset on didCommitLoad
+ https://bugs.webkit.org/show_bug.cgi?id=103290
+ <rdar://problem/12752467>
+
+ Reviewed by Darin Adler.
+
+ When a standard main frame load is committed, we reset the WebPage's
+ pageScaleFactor, if it's not the default. However, if the previous
+ page had a full-main-frame plugin that was handling page scaling itself,
+ WebPageProxy can have a cached pageScaleFactor != 1, while WebPage
+ now (since the plugin that was overriding (set)pageScaleFactor is gone)
+ has a pageScaleFactor of 1, causing us to skip the call to reset the
+ WebPage's pageScaleFactor.
+
+ Therefore, when WebPageProxy is notified that a standard main-frame load
+ is committed, reset its cached notion of the pageScaleFactor.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::didCommitLoadForFrame): Add a parameter which corresponds to FrameLoadType, so we can
+ determine whether a frame load is of FrameLoadTypeStandard (which matches the check to reset page scale in
+ WebFrameLoaderClient::didCommitLoad), so we can reset m_pageScaleFactor.
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy): Add frameLoadType parameter to didCommitLoadForFrame.
+ * UIProcess/WebPageProxy.messages.in: Add frameLoadType parameter to didCommitLoadForFrame.
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): Pass frameLoadType parameter to didCommitLoadForFrame.
+
+2013-01-10 Tim Horton <[email protected]>
+
PDFPlugin: Cmd-/+ should affect PDF page scale
https://bugs.webkit.org/show_bug.cgi?id=103285
<rdar://problem/12710469>
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (139340 => 139341)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-01-10 18:42:07 UTC (rev 139340)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-01-10 18:44:48 UTC (rev 139341)
@@ -2117,7 +2117,7 @@
}
}
-void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::MessageDecoder& decoder)
+void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, uint32_t opaqueFrameLoadType, const PlatformCertificateInfo& certificateInfo, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
@@ -2154,6 +2154,13 @@
m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
}
+ // Even if WebPage has the default pageScaleFactor (and therefore doesn't reset it),
+ // WebPageProxy's cache of the value can get out of sync (e.g. in the case where a
+ // plugin is handling page scaling itself) so we should reset it to the default
+ // for standard main frame loads.
+ if (frame->isMainFrame() && static_cast<FrameLoadType>(opaqueFrameLoadType) == FrameLoadTypeStandard)
+ m_pageScaleFactor = 1;
+
m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (139340 => 139341)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-01-10 18:42:07 UTC (rev 139340)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-01-10 18:44:48 UTC (rev 139341)
@@ -778,7 +778,7 @@
void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder&);
void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
- void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo&, CoreIPC::MessageDecoder&);
+ void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, uint32_t frameLoadType, const PlatformCertificateInfo&, CoreIPC::MessageDecoder&);
void didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
void didFinishLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (139340 => 139341)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2013-01-10 18:42:07 UTC (rev 139340)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2013-01-10 18:44:48 UTC (rev 139341)
@@ -124,7 +124,7 @@
DidRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID);
# Frame load messages
- DidCommitLoadForFrame(uint64_t frameID, WTF::String mimeType, bool hasCustomRepresentation, WebKit::PlatformCertificateInfo certificateInfo, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
+ DidCommitLoadForFrame(uint64_t frameID, WTF::String mimeType, bool hasCustomRepresentation, uint32_t loadType, WebKit::PlatformCertificateInfo certificateInfo, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
DidFailLoadForFrame(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
DidFailProvisionalLoadForFrame(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
DidFinishDocumentLoadForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (139340 => 139341)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2013-01-10 18:42:07 UTC (rev 139340)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2013-01-10 18:44:48 UTC (rev 139341)
@@ -464,7 +464,7 @@
// Notify the UIProcess.
- webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), response.mimeType(), m_frameHasCustomRepresentation, PlatformCertificateInfo(response), InjectedBundleUserMessageEncoder(userData.get())));
+ webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), response.mimeType(), m_frameHasCustomRepresentation, m_frame->coreFrame()->loader()->loadType(), PlatformCertificateInfo(response), InjectedBundleUserMessageEncoder(userData.get())));
// Only restore the scale factor for standard frame loads (of the main frame).
if (m_frame->isMainFrame() && m_frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard) {