Changeset 255786 in webkit


Ignore:
Timestamp:
Feb 4, 2020 8:32:18 PM (4 years ago)
Author:
Wenson Hsieh
Message:

REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
https://bugs.webkit.org/show_bug.cgi?id=207239
<rdar://problem/58686015>

Reviewed by Tim Horton.

Source/WebKit:

Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This
led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding
pointer event dispatch for synthetically generated mouse events (and made this determination by consulting
syntheticClickType()).

However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double-
tap), we currently pass NoTap as the synthetic click event type when creating the mouse event. This causes
additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of
"pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double
tapping to select a word.

Fix this by passing in OneFingerTap as the synthetic click type instead (since two-finger double taps should
already be handled by the two-finger double-tap magnification gesture).

Test: pointerevents/ios/pointer-events-for-double-tap.html

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):

LayoutTests:

Add a test to verify that performing a double tap on an element with a dblclick handler results in the following
sequence of events: [ "pointerdown", "pointerup", "pointerdown", "pointerup", "dblclick" ].

  • pointerevents/ios/pointer-events-for-double-tap-expected.txt: Added.
  • pointerevents/ios/pointer-events-for-double-tap.html: Added.
  • pointerevents/utils.js:

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

Add a helper method to simulate a double-tap gesture.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r255783 r255786  
     12020-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
     4        https://bugs.webkit.org/show_bug.cgi?id=207239
     5        <rdar://problem/58686015>
     6
     7        Reviewed by Tim Horton.
     8
     9        Add a test to verify that performing a double tap on an element with a dblclick handler results in the following
     10        sequence of events: `[ "pointerdown", "pointerup", "pointerdown", "pointerup", "dblclick" ]`.
     11
     12        * pointerevents/ios/pointer-events-for-double-tap-expected.txt: Added.
     13        * pointerevents/ios/pointer-events-for-double-tap.html: Added.
     14        * pointerevents/utils.js:
     15        (const.ui.new.UIController.prototype.doubleTap):
     16
     17        Add a helper method to simulate a double-tap gesture.
     18
    1192020-02-04  Ryan Haddad  <ryanhaddad@apple.com>
    220
  • trunk/LayoutTests/pointerevents/utils.js

    r253878 r255786  
    133133    {
    134134        return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`);
     135    }
     136
     137    doubleTap(options)
     138    {
     139        return this._run(`uiController.doubleTapAtPoint(${options.x}, ${options.y}, 0, () => uiController.uiScriptComplete())`);
    135140    }
    136141
  • trunk/Source/WebKit/ChangeLog

    r255785 r255786  
     12020-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
     4        https://bugs.webkit.org/show_bug.cgi?id=207239
     5        <rdar://problem/58686015>
     6
     7        Reviewed by Tim Horton.
     8
     9        Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This
     10        led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding
     11        pointer event dispatch for synthetically generated mouse events (and made this determination by consulting
     12        `syntheticClickType()`).
     13
     14        However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double-
     15        tap), we currently pass `NoTap` as the synthetic click event type when creating the mouse event. This causes
     16        additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of
     17        "pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double
     18        tapping to select a word.
     19
     20        Fix this by passing in `OneFingerTap` as the synthetic click type instead (since two-finger double taps should
     21        already be handled by the two-finger double-tap magnification gesture).
     22
     23        Test: pointerevents/ios/pointer-events-for-double-tap.html
     24
     25        * WebProcess/WebPage/ios/WebPageIOS.mm:
     26        (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
     27
    1282020-02-01  Darin Adler  <darin@apple.com>
    229
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r255710 r255786  
    834834    bool metaKey = modifiers.contains(WebEvent::Modifier::MetaKey);
    835835    auto roundedAdjustedPoint = roundedIntPoint(adjustedPoint);
    836     nodeRespondingToDoubleClick->document().frame()->eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 2, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap));
     836    nodeRespondingToDoubleClick->document().frame()->eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 2, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::OneFingerTap));
    837837    if (m_isClosed)
    838838        return;
    839     nodeRespondingToDoubleClick->document().frame()->eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 2, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap));
     839    nodeRespondingToDoubleClick->document().frame()->eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 2, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::OneFingerTap));
    840840}
    841841
Note: See TracChangeset for help on using the changeset viewer.