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

Changeset 245505 in webkit


Ignore:
Timestamp:
May 19, 2019, 2:34:24 PM (7 years ago)
Author:
graouts@webkit.org
Message:

[Pointer Events] A pointer should be marked as primary for all of its events
https://bugs.webkit.org/show_bug.cgi?id=197909
<rdar://problem/50801608>

Reviewed by Dean Jackson.

Source/WebCore:

Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
of the very first touch to start in a given sequence.

  • page/EventHandler.h:

LayoutTests:

Update tests to match expectations that only the first touch of a sequence is the primary pointer,
which applies to all of its events, even after the even is no longer touching the digitizer.

  • pointerevents/ios/over-enter-out-leave.html:
  • pointerevents/ios/pointer-event-order.html:
  • pointerevents/ios/pointer-events-implicit-capture.html:
  • pointerevents/ios/pointer-events-is-primary-expected.txt:
  • pointerevents/ios/pointer-events-is-primary.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245502 r245505  
     12019-05-19  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events] A pointer should be marked as primary for all of its events
     4        https://bugs.webkit.org/show_bug.cgi?id=197909
     5        <rdar://problem/50801608>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Update tests to match expectations that only the first touch of a sequence is the primary pointer,
     10        which applies to all of its events, even after the even is no longer touching the digitizer.
     11
     12        * pointerevents/ios/over-enter-out-leave.html:
     13        * pointerevents/ios/pointer-event-order.html:
     14        * pointerevents/ios/pointer-events-implicit-capture.html:
     15        * pointerevents/ios/pointer-events-is-primary-expected.txt:
     16        * pointerevents/ios/pointer-events-is-primary.html:
     17
    1182019-05-19  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/LayoutTests/pointerevents/ios/over-enter-out-leave.html

    r241760 r245505  
    2424            { type: "pointerenter", x: 100, y: 100, isPrimary: true },
    2525            { type: "pointerdown", x: 100, y: 100, isPrimary: true },
    26             { type: "pointerup", x: 100, y: 100, isPrimary: false },
    27             { type: "pointerout", x: 100, y: 100, isPrimary: false },
    28             { type: "pointerleave", x: 100, y: 100, isPrimary: false },
     26            { type: "pointerup", x: 100, y: 100, isPrimary: true },
     27            { type: "pointerout", x: 100, y: 100, isPrimary: true },
     28            { type: "pointerleave", x: 100, y: 100, isPrimary: true },
    2929        ]);
    3030        test.done();
  • trunk/LayoutTests/pointerevents/ios/pointer-event-order.html

    r244328 r245505  
    2121            { type: "pointerenter", x: 100, y: 100, isPrimary: true },
    2222            { type: "pointerdown", x: 100, y: 100, isPrimary: true },
    23             { type: "pointerup", x: 100, y: 100, isPrimary: false },
    24             { type: "pointerout", x: 100, y: 100, isPrimary: false },
    25             { type: "pointerleave", x: 100, y: 100, isPrimary: false },
     23            { type: "pointerup", x: 100, y: 100, isPrimary: true },
     24            { type: "pointerout", x: 100, y: 100, isPrimary: true },
     25            { type: "pointerleave", x: 100, y: 100, isPrimary: true },
    2626            { type: "click", x: 100, y: 100 },
    2727        ]);
  • trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html

    r240875 r245505  
    3535            { id: 2, type: "pointermove" },
    3636            { id: 1, type: "pointerup" },
    37             { id: 1, type: "lostpointercapture", isPrimary: false },
     37            { id: 1, type: "lostpointercapture", isPrimary: true },
    3838            { id: 2, type: "pointerup" },
    3939            { id: 2, type: "lostpointercapture", isPrimary: false }
  • trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary-expected.txt

    r238344 r245505  
    11
    2 PASS Oldest active touch has isPrimary = true.
     2PASS The first touch of a touch sequence has isPrimary = true.
    33
  • trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html

    r243645 r245505  
    1515target_test((target, test) => {
    1616    target.style.touchAction = "none";
    17     const eventTracker = new EventTracker(target, ["pointerdown", "pointermove"]);
     17    const eventTracker = new EventTracker(target, ["pointerover", "pointerenter", "pointerdown", "pointermove", "pointerup", "pointerout", "pointerleave"]);
    1818
    1919    const one = ui.finger();
    2020    const two = ui.finger();
     21    const three = ui.finger();
    2122    ui.sequence([
    2223        one.begin({ x: 10, y: 10 }),
     
    2627        one.end(),
    2728        two.move({ x: 50, y: 50 }),
    28         two.end()
     29        two.end(),
     30        three.begin({ x: 10, y: 10 }),
     31        three.end(),
    2932    ]).then(() => {
    3033        eventTracker.assertMatchesEvents([
     34            // Yielded by one.begin({ x: 10, y: 10 }).
     35            { id: 1, type: "pointerover", x: 10, y: 10, isPrimary: true },
     36            { id: 1, type: "pointerenter", x: 10, y: 10, isPrimary: true },
    3137            { id: 1, type: "pointerdown", x: 10, y: 10, isPrimary: true },
     38            // Yielded by two.begin({ x: 50, y: 50 }).
     39            { id: 2, type: "pointerover", x: 50, y: 50, isPrimary: false },
     40            { id: 2, type: "pointerenter", x: 50, y: 50, isPrimary: false },
    3241            { id: 2, type: "pointerdown", x: 50, y: 50, isPrimary: false },
     42            // Yielded by two.move({ x: 70, y: 70 }).
    3343            { id: 2, type: "pointermove", x: 70, y: 70, isPrimary: false },
     44            // Yielded by one.move({ x: 30, y: 30 }).
    3445            { id: 1, type: "pointermove", x: 30, y: 30, isPrimary: true },
    35             { id: 2, type: "pointermove", x: 50, y: 50, isPrimary: true }
     46            // Yielded by one.end().
     47            { id: 1, type: "pointerup", x: 30, y: 30, isPrimary: true },
     48            { id: 1, type: "pointerout", x: 30, y: 30, isPrimary: true },
     49            { id: 1, type: "pointerleave", x: 30, y: 30, isPrimary: true },
     50            // Yielded by two.move({ x: 50, y: 50 }).
     51            { id: 2, type: "pointermove", x: 50, y: 50, isPrimary: false },
     52            // Yielded by two.end().
     53            { id: 2, type: "pointerup", x: 50, y: 50, isPrimary: false },
     54            { id: 2, type: "pointerout", x: 50, y: 50, isPrimary: false },
     55            { id: 2, type: "pointerleave", x: 50, y: 50, isPrimary: false },
     56            // Yielded by three.begin({ x: 10, y: 10 }).
     57            { id: 3, type: "pointerover", x: 10, y: 10, isPrimary: true },
     58            { id: 3, type: "pointerenter", x: 10, y: 10, isPrimary: true },
     59            { id: 3, type: "pointerdown", x: 10, y: 10, isPrimary: true },
     60            // Yielded by three.end().
     61            { id: 3, type: "pointerup", x: 10, y: 10, isPrimary: true },
     62            { id: 3, type: "pointerout", x: 10, y: 10, isPrimary: true },
     63            { id: 3, type: "pointerleave", x: 10, y: 10, isPrimary: true },
    3664        ]);
    3765        test.done();
    3866    });
    39 }, "Oldest active touch has isPrimary = true.");
     67}, "The first touch of a touch sequence has isPrimary = true.");
    4068
    4169</script>
  • trunk/Source/WebCore/ChangeLog

    r245504 r245505  
     12019-05-19  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events] A pointer should be marked as primary for all of its events
     4        https://bugs.webkit.org/show_bug.cgi?id=197909
     5        <rdar://problem/50801608>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
     10        of the very first touch to start in a given sequence.
     11
     12        * page/EventHandler.h:
     13
    1142019-05-19  Darin Adler  <darin@apple.com>
    215
  • trunk/Source/WebCore/page/EventHandler.h

    r245062 r245505  
    615615#endif
    616616
     617#if ENABLE(POINTER_EVENTS) && ENABLE(IOS_TOUCH_EVENTS)
     618    unsigned m_touchIdentifierForPrimaryTouch { 0 };
     619#endif
     620
    617621    double m_maxMouseMovedDuration { 0 };
    618622    bool m_didStartDrag { false };
Note: See TracChangeset for help on using the changeset viewer.