Changeset 245695 in webkit
- Timestamp:
- May 23, 2019 11:02:13 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245693 r245695 1 2019-05-23 Antoine Quint <graouts@apple.com> 2 3 [Pointer Events] The mouseover, mouseout, mouseenter, and mouseleave events should not be prevented while the pointer is down 4 https://bugs.webkit.org/show_bug.cgi?id=198177 5 6 Reviewed by Dean Jackson. 7 8 Add a test that listens to all mouse events and checks which are dispatched in the case preventDefault() is called when handling 9 "pointerdown" and when it isn't. 10 11 * platform/mac-wk1/TestExpectations: Skipping the test on WK1 where the sequence of dispatched mouse events does not match. 12 * pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed-expected.txt: Added. 13 * pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html: Added. 14 1 15 2019-05-23 Truitt Savell <tsavell@apple.com> 2 16 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r245257 r245695 700 700 webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource.html [ Skip ] 701 701 webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource-iframe.html [ Skip ] 702 703 webkit.org/b/198177 pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r245694 r245695 1 2019-05-23 Antoine Quint <graouts@apple.com> 2 3 [Pointer Events] The mouseover, mouseout, mouseenter, and mouseleave events should not be prevented while the pointer is down 4 https://bugs.webkit.org/show_bug.cgi?id=198177 5 6 Reviewed by Dean Jackson. 7 8 Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html 9 10 The Pointer Event spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "the mouseover, 11 mouseout, mouseenter, and mouseleave events are never prevented (even if the pointer is down)." We add a new static function which 12 indicates what is "compatibility" mouse event since those should be excluded, along with "click", which we already excluded. 13 14 * dom/Element.cpp: 15 (WebCore::isCompatibilityMouseEvent): 16 (WebCore::Element::dispatchMouseEvent): 17 1 18 2019-05-23 Jon Davis <jond@apple.com> 2 19 -
trunk/Source/WebCore/dom/Element.cpp
r245642 r245695 289 289 } 290 290 291 static bool isCompatibilityMouseEvent(const MouseEvent& mouseEvent) 292 { 293 // https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events 294 const auto& type = mouseEvent.type(); 295 return type != eventNames().clickEvent && type != eventNames().mouseoverEvent && type != eventNames().mouseoutEvent && type != eventNames().mouseenterEvent && type != eventNames().mouseleaveEvent; 296 } 297 291 298 bool Element::dispatchMouseEvent(const PlatformMouseEvent& platformEvent, const AtomicString& eventType, int detail, Element* relatedTarget) 292 299 { … … 315 322 if (auto* page = document().page()) { 316 323 page->pointerCaptureController().dispatchEvent(*pointerEvent, this); 317 if ( mouseEvent->type() != eventNames().clickEvent&& page->pointerCaptureController().preventsCompatibilityMouseEventsForIdentifier(pointerEvent->pointerId()))324 if (isCompatibilityMouseEvent(mouseEvent) && page->pointerCaptureController().preventsCompatibilityMouseEventsForIdentifier(pointerEvent->pointerId())) 318 325 return false; 319 326 }
Note: See TracChangeset
for help on using the changeset viewer.