[WK2] Add support for Window's beforeprint / afterprint events
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 21:43:24 +0000 (21:43 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 21:43:24 +0000 (21:43 +0000)
commit8583647e67f3ba8167c726e1c0bde064bdc650e0
tree53b1744bb51023000bb6e2de8ccd0d3523a87f4e
parent564f3cd1e816e6efb992b1fa1f92b6911d9dbbc3
[WK2] Add support for Window's beforeprint / afterprint events
https://bugs.webkit.org/show_bug.cgi?id=196478

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

* web-platform-tests/html/browsers/the-window-object/security-window/window-security.https-expected.txt:
* web-platform-tests/html/browsers/the-window-object/security-window/window-security.sub-expected.txt:
* web-platform-tests/html/browsers/the-window-object/window-properties.https-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/body-exposed-window-event-handlers-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt:

Source/WebCore:

Add support for Window's beforeprint / afterprint events as per:
- https://html.spec.whatwg.org/#dom-print

Blink and Gecko already support this.

Test: printing/printing-events.html

* dom/EventNames.h:
* html/HTMLAttributeNames.in:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* page/Page.cpp:
(WebCore::dispatchPrintEvent):
(WebCore::Page::dispatchBeforePrintEvent):
(WebCore::Page::dispatchAfterPrintEvent):
* page/Page.h:
* page/WindowEventHandlers.idl:

Source/WebKit:

Add support for Window's beforeprint / afterprint events as per:
- https://html.spec.whatwg.org/#dom-print

Blink and Gecko already support this.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::endPrinting):

Tools:

Add minimal implementation for printFrame in WebKitTestRunner.

* WebKitTestRunner/TestController.cpp:
(WTR::printFrame):
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

LayoutTests:

Add layout test coverage.

* TestExpectations:
* platform/wk2/TestExpectations:
* printing/printing-events-expected.txt: Added.
* printing/printing-events.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/security-window/window-security.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/security-window/window-security.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-properties.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/body-exposed-window-event-handlers-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt
LayoutTests/platform/wk2/TestExpectations
LayoutTests/printing/printing-events-expected.txt [new file with mode: 0644]
LayoutTests/printing/printing-events.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/EventNames.h
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/WindowEventHandlers.idl
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp