PDF SUBFRAMES: Incomplete repaint after pinch to zoom
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2011 19:01:51 +0000 (19:01 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2011 19:01:51 +0000 (19:01 +0000)
commitead74f6cbc08e2d6bf0095c98740f00888f7f33a
tree1f265e1e5f7fcb477cd3897a2ae5dc0c91fef7e5
parent7a92794da31488152a302192b9f266f36af5d5a0
PDF SUBFRAMES: Incomplete repaint after pinch to zoom
https://bugs.webkit.org/show_bug.cgi?id=70821
<rdar://problem/10312733>

Reviewed by Simon Fraser.

Add a new pure virtual member function, Plugin::wantsWindowRelativeCoordinates.
If a plug-in subclass returns true, we'll keep giving the plug-in coordinates that
are relative to the containing window. If a plug-in subclass returns false, we'll give it
coordinates in a much more sane coordinate system, with the origin at the top left corner of the plug-in.

Change BuiltinPDFView to return false so that it'll work correctly with pinch to zoom.

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::wantsWindowRelativeCoordinates):
Make wantsWindowRelativeCoordinates return true.

* WebProcess/Plugins/PDF/BuiltInPDFView.cpp:
(WebKit::BuiltInPDFView::paint):
Remove translation since the graphics context is already set up in the right way.

(WebKit::BuiltInPDFView::paintContent):
No need to offset by the plug-in view location anymore.

(WebKit::BuiltInPDFView::paintControls):
Account for the scrollbars being children of the parent scroll view here.

(WebKit::BuiltInPDFView::wantsWindowRelativeCoordinates):
Return false.

(WebKit::BuiltInPDFView::convertFromContainingViewToScrollbar):
Implement this so that scrollbar hit testing works correctly.

* WebProcess/Plugins/Plugin.h:
Add wantsWindowRelativeCoordinates.

* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::wantsWindowRelativeCoordinates):
Return true for now.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::renderer):
Add simple getter.

(WebKit::PluginView::paint):
Handle the case when the plug-in doesn't want window relative coordinates.

(WebKit::PluginView::transformsAffectFrameRect):
Return true here.

(WebKit::PluginView::viewGeometryDidChange):
No need to adjust the bounds to account for the scale factor now, since the frame rect will always be the
same regardless of the transform.

(WebKit::PluginView::clipRectInWindowCoordinates):
Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
Source/WebKit2/WebProcess/Plugins/Plugin.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h