[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointereven...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 13:31:17 +0000 (13:31 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 13:31:17 +0000 (13:31 +0000)
commitd5294003b17701ad41a3472f9541357196476966
tree502898096866c7db34ba54e44cdc40a1f25a72de
parent3daf39bee7031d879bb25e599235c409af362e7d
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
https://bugs.webkit.org/show_bug.cgi?id=197004

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node-expected.txt: Added.

Source/WebCore:

We need to release pointer capture when an element that has pointer capture is disconnected from the DOM.

* dom/Element.cpp:
(WebCore::Element::removedFromAncestor): Notify the PointerCaptureController that an element was disconnected.
* dom/PointerEvent.cpp:
(WebCore::PointerEvent::create): Broaden createPointerCancelEvent() to take in an event type so that we may use it to create a
lostpointercapture event as well.
(WebCore::PointerEvent::createPointerCancelEvent): Deleted.
* dom/PointerEvent.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::elementWasRemoved): Check whether the provided element matches one of the target overrides recorded
in the map of captured pointer IDs.
(WebCore::PointerCaptureController::pointerEventWasDispatched): This block of code was actually useless in this location, the new code
added in elementWasRemoved() performs the actions that the spec text mandates.
(WebCore::PointerCaptureController::cancelPointer): Replace the call to createPointerCancelEvent() with one to create().
* page/PointerCaptureController.h:

LayoutTests:

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/PointerEvent.cpp
Source/WebCore/dom/PointerEvent.h
Source/WebCore/page/PointerCaptureController.cpp
Source/WebCore/page/PointerCaptureController.h