Pass the right dirty rect to Plugin::paint
A typo in r79040 broke this. Much of this patch is just support for testing the fix.
Fixes <http://webkit.org/b/55365> <rdar://problem/9031089> REGRESSION (r79040): WebKit2:
Large portions of pages with plugins paint black
Reviewed by Anders Carlsson.
Source/WebKit2:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint): Pass the dirty rect we calculated earlier to Plugin::paint,
rather than just passing along the dirty rect that was passed into this function. This is
the bug fix.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageForceRepaint):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
Added new SPI. Just calls through to WebPage::forceRepaintWithoutCallback.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::forceRepaintWithoutCallback): Moved code to force a repaint here...
(WebKit::WebPage::forceRepaint): ...from here.
* WebProcess/WebPage/WebPage.h: Added forceRepaintWithoutCallback.
Tools:
Add a test for the paint rect passed via WM_PAINT to windowless plugins
* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
(PluginTest::NPP_HandleEvent):
* DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
Added NPP_HandleEvent. Just returns 0 at this level.
* DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowlessPaintRectCoordinates.cpp: Added.
(WindowlessPaintRectCoordinates::WindowlessPaintRectCoordinates): Call up to the base class.
(WindowlessPaintRectCoordinates::NPP_New): Mark ourselves as windowless.
(WindowlessPaintRectCoordinates::NPP_HandleEvent): Check that the paint rect passed via
WM_PAINT has the expected coordinates.
* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(NPP_HandleEvent): Give the PluginTest a chance to handle the event before doing anything
else.
* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Added new file, let VS
resort things.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didFinishLoadForFrame): Added a call to WKBundlePageForceRepaint.
This is roughly equivalent to the call to -[WebView displayIfNeeded] in -[FrameLoadDelegate
webView:didFinishLoadForFrame:] in DumpRenderTree.
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView): Tell the WKView it's in a window so that plugins
can start running.
LayoutTests:
Add a test for the paint rect passed via WM_PAINT to windowless plugins
* platform/win-wk2/platform/win/plugins/windowless-paint-rect-coordinates-expected.txt: Added.
* platform/win/plugins/windowless-paint-rect-coordinates-expected.txt: Added. WebKit1
doesn't pass a paint rect via WM_PAINT, so we have different results there.
* platform/win/plugins/windowless-paint-rect-coordinates.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed