PDFPlugins are clipped in link previews (and remain so when opened)
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Aug 2015 01:06:14 +0000 (01:06 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Aug 2015 01:06:14 +0000 (01:06 +0000)
commit02ded59f2df7ed2176ed316028b1f12f39dff7bd
treee21ee5a23fdfe5e43c9886c88b53e4b009b62e4c
parentf3c336fab5b6cd1355f11c6d08b0d2bcc50a6c2f
PDFPlugins are clipped in link previews (and remain so when opened)
https://bugs.webkit.org/show_bug.cgi?id=147708
<rdar://problem/22055130>

Reviewed by Simon Fraser.

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:webView:]):
(-[WKView _supportsArbitraryLayoutModes]):
(-[WKView _didCommitLoadForMainFrame]):
(-[WKView _setLayoutMode:]):
(-[WKView _setViewScale:]):
Avoid using any layout mode other than "ViewSize" for main frame PluginDocuments,
because they will often end up behaving incorrectly (especially with PDFPlugin,
which is even more special in that it takes over application of page scale).

Save any incoming changes to the viewScale and layoutMode, and re-apply
them once we load something in the main frame that is *not* a PluginDocument.

* UIProcess/API/mac/WKViewInternal.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scalePage):
Make sure to reset WebCore's page scale if the main frame contains a
PluginDocument that takes care of page scale itself.

(WebKit::WebPage::didCommitLoad):
Do the same thing as what we do in WKView _didCommitLoadForMainFrame,
but without the UI process round-trip, to avoid an ugly flash.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didCommitLoad):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::containsPluginDocument):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
Plumb and keep track of whether the main frame contains a PluginDocument or not.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/WebFrameProxy.cpp
Source/WebKit2/UIProcess/WebFrameProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp