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

Changeset 271216 in webkit


Ignore:
Timestamp:
Jan 6, 2021, 3:28:43 PM (6 years ago)
Author:
Devin Rousso
Message:

[iOS] REGRESSION(r265088): "pointerdown" doesn't fire using a trackpad after double-tapping
https://bugs.webkit.org/show_bug.cgi?id=220072

Reviewed by Antoine Quint.

r265088 made it such that pointer events are not created for mouse events if there is an
existing entry for any touch event in m_activePointerIdsToCapturingData. Unfortunately,
entries only appear to be removed from m_activePointerIdsToCapturingData from three places:

  • when the single tap gesture recognizer resets (-[WKContentView _singleTapDidReset:])
  • if a potential tap cannot be committed (-[WKContentView _commitPotentialTapFailed])
  • after a synthetic click (-[WKContentView _didCompleteSyntheticClick])

AFAICT (and seeing how there's a gesture recognizer for double-tap, long press, etc.), this
does not include other situations like the second tap of a double-tap. In order to fix this:

  • eagerly touchWithIdentifierWasRemoved when dispatching "pointerup" for a touch event
  • (just in case) don't prevent the pointer event for mouse events if the existing touch event has been cancelled or is not currently pressed
  • page/PointerCaptureController.cpp:

(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::pointerEventForMouseEvent):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r271214 r271216  
     12021-01-06  Devin Rousso  <drousso@apple.com>
     2
     3        [iOS] REGRESSION(r265088): "pointerdown" doesn't fire using a trackpad after double-tapping
     4        https://bugs.webkit.org/show_bug.cgi?id=220072
     5
     6        Reviewed by Antoine Quint.
     7
     8        r265088 made it such that pointer events are not created for mouse events if there is an
     9        existing entry for any touch event in `m_activePointerIdsToCapturingData`. Unfortunately,
     10        entries only appear to be removed from `m_activePointerIdsToCapturingData` from three places:
     11         - when the single tap gesture recognizer resets (`-[WKContentView _singleTapDidReset:]`)
     12         - if a potential tap cannot be committed (`-[WKContentView _commitPotentialTapFailed]`)
     13         - after a synthetic click (`-[WKContentView _didCompleteSyntheticClick]`)
     14        AFAICT (and seeing how there's a gesture recognizer for double-tap, long press, etc.), this
     15        does not include other situations like the second tap of a double-tap. In order to fix this:
     16         - eagerly `touchWithIdentifierWasRemoved` when dispatching `"pointerup"` for a touch event
     17         - (just in case) don't prevent the pointer event for mouse events if the existing touch
     18           event has been cancelled or is not currently pressed
     19
     20        * page/PointerCaptureController.cpp:
     21        (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
     22        (WebCore::PointerCaptureController::pointerEventForMouseEvent):
     23
    1242021-01-06  Andy Estes  <aestes@apple.com>
    225
  • trunk/Source/WebCore/page/PointerCaptureController.cpp

    r270582 r271216  
    296296        dispatchEnterOrLeaveEvent(eventNames().pointerleaveEvent);
    297297        capturingData.previousTarget = nullptr;
     298
     299        touchWithIdentifierWasRemoved(pointerEvent->pointerId());
    298300    }
    299301}
     
    305307    // for instance in the case of a long press to initiate a system drag.
    306308    for (auto& capturingData : m_activePointerIdsToCapturingData.values()) {
    307         if (capturingData.pointerType == PointerEvent::touchPointerType())
     309        if (capturingData.pointerType == PointerEvent::touchPointerType() && capturingData.pointerIsPressed && !capturingData.cancelled)
    308310            return nullptr;
    309311    }
Note: See TracChangeset for help on using the changeset viewer.