Changeset 79863 in webkit


Ignore:
Timestamp:
Feb 28, 2011 7:31:47 AM (13 years ago)
Author:
Adam Roben
Message:

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.
Location:
trunk
Files:
7 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r79861 r79863  
     12011-02-28  Adam Roben  <aroben@apple.com>
     2
     3        Add a test for the paint rect passed via WM_PAINT to windowless plugins
     4
     5        Test for <http://webkit.org/b/55365> <rdar://problem/9031089> REGRESSION (r79040): WebKit2:
     6        Large portions of pages with plugins paint black
     7
     8        Reviewed by Anders Carlsson.
     9
     10        * platform/win-wk2/platform/win/plugins/windowless-paint-rect-coordinates-expected.txt: Added.
     11        * platform/win/plugins/windowless-paint-rect-coordinates-expected.txt: Added. WebKit1
     12        doesn't pass a paint rect via WM_PAINT, so we have different results there.
     13        * platform/win/plugins/windowless-paint-rect-coordinates.html: Added.
     14
    1152011-02-28  Vsevolod Vlasov  <vsevik@chromium.org>
    216
  • trunk/Source/WebKit2/ChangeLog

    r79839 r79863  
     12011-02-28  Adam Roben  <aroben@apple.com>
     2
     3        Pass the right dirty rect to Plugin::paint
     4
     5        A typo in r79040 broke this. Much of this patch is just support for testing the fix.
     6
     7        Fixes <http://webkit.org/b/55365> <rdar://problem/9031089> REGRESSION (r79040): WebKit2:
     8        Large portions of pages with plugins paint black
     9
     10        Reviewed by Anders Carlsson.
     11
     12        * WebProcess/Plugins/PluginView.cpp:
     13        (WebKit::PluginView::paint): Pass the dirty rect we calculated earlier to Plugin::paint,
     14        rather than just passing along the dirty rect that was passed into this function. This is
     15        the bug fix.
     16
     17        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
     18        (WKBundlePageForceRepaint):
     19        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
     20        Added new SPI. Just calls through to WebPage::forceRepaintWithoutCallback.
     21
     22        * WebProcess/WebPage/WebPage.cpp:
     23        (WebKit::WebPage::forceRepaintWithoutCallback): Moved code to force a repaint here...
     24        (WebKit::WebPage::forceRepaint): ...from here.
     25
     26        * WebProcess/WebPage/WebPage.h: Added forceRepaintWithoutCallback.
     27
    1282011-02-27  Sam Weinig  <sam@webkit.org>
    229
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r78418 r79863  
    213213}
    214214#endif
     215
     216void WKBundlePageForceRepaint(WKBundlePageRef page)
     217{
     218    toImpl(page)->forceRepaintWithoutCallback();
     219}
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h

    r75253 r79863  
    4646WK_EXPORT void WKBundlePageSetPageZoomFactor(WKBundlePageRef page, double zoomFactor);
    4747
     48WK_EXPORT void WKBundlePageForceRepaint(WKBundlePageRef page);
     49
    4850#ifdef __cplusplus
    4951}
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r79157 r79863  
    534534        context->save();
    535535        context->translate(-documentOriginInWindowCoordinates.x(), -documentOriginInWindowCoordinates.y());
    536         m_plugin->paint(context, dirtyRect);
     536        m_plugin->paint(context, paintRectInWindowCoordinates);
    537537        context->restore();
    538538    }
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r79803 r79863  
    12821282}
    12831283
     1284void WebPage::forceRepaintWithoutCallback()
     1285{
     1286    m_drawingArea->forceRepaint();
     1287}
     1288
    12841289void WebPage::forceRepaint(uint64_t callbackID)
    12851290{
    1286     m_drawingArea->forceRepaint();
     1291    forceRepaintWithoutCallback();
    12871292    send(Messages::WebPageProxy::VoidCallback(callbackID));
    12881293}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r79803 r79863  
    340340    void setMemoryCacheMessagesEnabled(bool);
    341341
     342    void forceRepaintWithoutCallback();
     343
    342344private:
    343345    WebPage(uint64_t pageID, const WebPageCreationParameters&);
  • trunk/Tools/ChangeLog

    r79862 r79863  
     12011-02-28  Adam Roben  <aroben@apple.com>
     2
     3        Add a test for the paint rect passed via WM_PAINT to windowless plugins
     4
     5        Test for <http://webkit.org/b/55365> <rdar://problem/9031089> REGRESSION (r79040): WebKit2:
     6        Large portions of pages with plugins paint black
     7
     8        Reviewed by Anders Carlsson.
     9
     10        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
     11        (PluginTest::NPP_HandleEvent):
     12        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
     13        Added NPP_HandleEvent. Just returns 0 at this level.
     14
     15        * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowlessPaintRectCoordinates.cpp: Added.
     16        (WindowlessPaintRectCoordinates::WindowlessPaintRectCoordinates): Call up to the base class.
     17        (WindowlessPaintRectCoordinates::NPP_New): Mark ourselves as windowless.
     18        (WindowlessPaintRectCoordinates::NPP_HandleEvent): Check that the paint rect passed via
     19        WM_PAINT has the expected coordinates.
     20
     21        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
     22        (NPP_HandleEvent): Give the PluginTest a chance to handle the event before doing anything
     23        else.
     24
     25        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Added new file, let VS
     26        resort things.
     27
     28        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     29        (WTR::InjectedBundlePage::didFinishLoadForFrame): Added a call to WKBundlePageForceRepaint.
     30        This is roughly equivalent to the call to -[WebView displayIfNeeded] in -[FrameLoadDelegate
     31        webView:didFinishLoadForFrame:] in DumpRenderTree.
     32
     33        * WebKitTestRunner/win/PlatformWebViewWin.cpp:
     34        (WTR::PlatformWebView::PlatformWebView): Tell the WKView it's in a window so that plugins
     35        can start running.
     36
    1372011-02-28  Adam Roben  <aroben@apple.com>
    238
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp

    r79157 r79863  
    8080}
    8181
     82int16_t PluginTest::NPP_HandleEvent(void*)
     83{
     84    return 0;
     85}
     86
    8287void PluginTest::NPN_InvalidateRect(NPRect* invalidRect)
    8388{
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h

    r79157 r79863  
    6161    virtual NPError NPP_GetValue(NPPVariable, void* value);
    6262    virtual NPError NPP_SetWindow(NPP, NPWindow*);
     63    virtual int16_t NPP_HandleEvent(void* event);
    6364
    6465    // NPN functions.
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp

    r78359 r79863  
    698698    PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
    699699
     700    if (obj->pluginTest->NPP_HandleEvent(event) == 1)
     701        return 1;
     702
    700703#ifdef XP_MACOSX
    701704#ifndef NP_NO_CARBON
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj

    r79157 r79863  
    399399                        </File>
    400400                        <File
     401                                RelativePath="..\Tests\GetURLWithJavaScriptURLDestroyingPlugin.cpp"
     402                                >
     403                        </File>
     404                        <File
    401405                                RelativePath="..\Tests\GetUserAgentWithNullNPPFromNPPNew.cpp"
    402                                 >
    403                         </File>
    404                         <File
    405                                 RelativePath="..\Tests\GetURLWithJavaScriptURLDestroyingPlugin.cpp"
    406406                                >
    407407                        </File>
     
    446446                                </File>
    447447                                <File
     448                                        RelativePath="..\Tests\win\WindowlessPaintRectCoordinates.cpp"
     449                                        >
     450                                </File>
     451                                <File
    448452                                        RelativePath="..\Tests\win\WindowRegionIsSetToClipRect.cpp"
    449453                                        >
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r79793 r79863  
    535535    InjectedBundle::shared().setTopLoadingFrame(0);
    536536
     537    WKBundlePageForceRepaint(m_page);
     538
    537539    if (InjectedBundle::shared().layoutTestController()->waitToDump())
    538540        return;
  • trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp

    r73976 r79863  
    5555    m_window = CreateWindowExW(0, hostWindowClassName, L"WebKitTestRunner", WS_OVERLAPPEDWINDOW, 0 /*XOFFSET*/, 0 /*YOFFSET*/, viewRect.right, viewRect.bottom, 0, 0, GetModuleHandle(0), 0);
    5656    m_view = WKViewCreate(viewRect, contextRef, pageGroupRef, m_window);
     57    WKViewSetIsInWindow(m_view, true);
    5758}
    5859
Note: See TracChangeset for help on using the changeset viewer.