Changeset 70247 in webkit


Ignore:
Timestamp:
Oct 21, 2010 10:04:16 AM (13 years ago)
Author:
Adam Roben
Message:

Ask the UI client to close the page when the WKView receives a WM_CLOSE message

Fixes <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
close its parent window

Reviewed by Jon Honeycutt.

WebKit2:

  • UIProcess/win/WebView.cpp:

(WebKit::WebView::wndProc): Call through to WebPageProxy::tryClose when
we receive a WM_CLOSE message, rather than passing the message along to
::DefWindowProcW. tryClose will end up asking the UI client to close
the page, while ::DefWindowProcW would destroy us synchronously without
notifying the UI client at all. One case where we'll get sent a
WM_CLOSE message is when the user presses Ctrl+W when using the Adobe
Reader plugin to view a PDF.

WebKitTools:

Test that the UI client gets notified when WKView receives a WM_CLOSE message

  • TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: Added.

(TestWebKitAPI::close): Record that this function was called.
(TestWebKitAPI::WebKit2_WMCloseCallsUIClientClose): Create a WKView,
send it a WM_CLOSE message, and test that the UI client's close
callback got called. Note that this will hang if the bug is
reintroduced; <http://webkit.org/b/48043> covers making TestWebKitAPI
able to handle hangs.

  • TestWebKitAPI/win/TestWebKitAPI.vcproj: Added the new test.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70245 r70247  
     12010-10-20  Adam Roben  <aroben@apple.com>
     2
     3        Ask the UI client to close the page when the WKView receives a WM_CLOSE
     4        message
     5
     6        Fixes <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
     7        Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
     8        close its parent window
     9
     10        Reviewed by Jon Honeycutt.
     11
     12        * UIProcess/win/WebView.cpp:
     13        (WebKit::WebView::wndProc): Call through to WebPageProxy::tryClose when
     14        we receive a WM_CLOSE message, rather than passing the message along to
     15        ::DefWindowProcW. tryClose will end up asking the UI client to close
     16        the page, while ::DefWindowProcW would destroy us synchronously without
     17        notifying the UI client at all. One case where we'll get sent a
     18        WM_CLOSE message is when the user presses Ctrl+W when using the Adobe
     19        Reader plugin to view a PDF.
     20
    1212010-10-20  Adam Roben  <aroben@apple.com>
    222
  • trunk/WebKit2/UIProcess/win/WebView.cpp

    r70245 r70247  
    8282
    8383    switch (message) {
     84        case WM_CLOSE:
     85            m_page->tryClose();
     86            break;
    8487        case WM_DESTROY:
    8588            m_isBeingDestroyed = true;
  • trunk/WebKitTools/ChangeLog

    r70246 r70247  
     12010-10-20  Adam Roben  <aroben@apple.com>
     2
     3        Test that the UI client gets notified when WKView receives a WM_CLOSE
     4        message
     5
     6        Test for <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
     7        Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
     8        close its parent window
     9
     10        Reviewed by Jon Honeycutt.
     11
     12        * TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: Added.
     13        (TestWebKitAPI::close): Record that this function was called.
     14        (TestWebKitAPI::WebKit2_WMCloseCallsUIClientClose): Create a WKView,
     15        send it a WM_CLOSE message, and test that the UI client's close
     16        callback got called. Note that this will hang if the bug is
     17        reintroduced; <http://webkit.org/b/48043> covers making TestWebKitAPI
     18        able to handle hangs.
     19
     20        * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added the new test.
     21
    1222010-10-20  Adam Roben  <aroben@apple.com>
    223
  • trunk/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj

    r70194 r70247  
    472472                                                >
    473473                                        </File>
     474                                        <File
     475                                                RelativePath="..\Tests\WebKit2\win\WMCloseCallsUIClientClose.cpp"
     476                                                >
     477                                        </File>
    474478                                </Filter>
    475479                        </Filter>
Note: See TracChangeset for help on using the changeset viewer.