⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244328 in webkit


Ignore:
Timestamp:
Apr 16, 2019, 1:03:56 AM (7 years ago)
Author:
graouts@webkit.org
Message:

[iOS] Redundant pointer events causes material design buttons to flush twice
https://bugs.webkit.org/show_bug.cgi?id=196914
<rdar://problem/49571860>

Reviewed by Dean Jackson.

Source/WebCore:

Test: pointerevents/ios/pointer-event-order.html

Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.

  • dom/Element.cpp:

(WebCore::Element::dispatchMouseEvent):

LayoutTests:

Add a new test that listens to all pointer event types as well as click, which forces the dispatch of compatibility mouse events
along with the click which would trigger duplicated pointer events prior to the source changes.

To ensure the new test added runs smoothly with a preceeding test that also uses ui.tap(), we add a delay to guarantee that no
double-taps are seen rather two successive single taps.

  • pointerevents/ios/pointer-event-order-expected.txt: Added.
  • pointerevents/ios/pointer-event-order.html: Added.
  • pointerevents/utils.js:

(const.ui.new.UIController.prototype.tap):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r244325 r244328  
     12019-04-15  Antoine Quint  <graouts@apple.com>
     2
     3        [iOS] Redundant pointer events causes material design buttons to flush twice
     4        https://bugs.webkit.org/show_bug.cgi?id=196914
     5        <rdar://problem/49571860>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a new test that listens to all pointer event types as well as click, which forces the dispatch of compatibility mouse events
     10        along with the click which would trigger duplicated pointer events prior to the source changes.
     11
     12        To ensure the new test added runs smoothly with a preceeding test that also uses ui.tap(), we add a delay to guarantee that no
     13        double-taps are seen rather two successive single taps.
     14
     15        * pointerevents/ios/pointer-event-order-expected.txt: Added.
     16        * pointerevents/ios/pointer-event-order.html: Added.
     17        * pointerevents/utils.js:
     18        (const.ui.new.UIController.prototype.tap):
     19
    1202019-04-15  John Wilander  <wilander@apple.com>
    221
  • trunk/LayoutTests/pointerevents/utils.js

    r243645 r244328  
    121121    tap(options)
    122122    {
    123         return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`);
     123        // Add a delay to ensure sequence of tap() calls don't yield double taps.
     124        const delay = 1000;
     125        return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`).then(() => {
     126            return new Promise(resolve => setTimeout(resolve, delay));
     127        });
    124128    }
    125129
  • trunk/Source/WebCore/ChangeLog

    r244325 r244328  
     12019-04-15  Antoine Quint  <graouts@apple.com>
     2
     3        [iOS] Redundant pointer events causes material design buttons to flush twice
     4        https://bugs.webkit.org/show_bug.cgi?id=196914
     5        <rdar://problem/49571860>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Test: pointerevents/ios/pointer-event-order.html
     10
     11        Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.
     12
     13        * dom/Element.cpp:
     14        (WebCore::Element::dispatchMouseEvent):
     15
    1162019-04-15  John Wilander  <wilander@apple.com>
    217
  • trunk/Source/WebCore/dom/Element.cpp

    r244046 r244328  
    303303    bool didNotSwallowEvent = true;
    304304
    305 #if ENABLE(POINTER_EVENTS)
     305#if ENABLE(POINTER_EVENTS) && !ENABLE(TOUCH_EVENTS)
    306306    if (RuntimeEnabledFeatures::sharedFeatures().pointerEventsEnabled()) {
    307307        if (auto pointerEvent = PointerEvent::create(mouseEvent)) {
Note: See TracChangeset for help on using the changeset viewer.