WebKit Bugzilla
Attachment 369296 Details for
Bug 197665
: [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197665-20190507184417.patch (text/plain), 11.04 KB, created by
Antoine Quint
on 2019-05-07 09:44:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2019-05-07 09:44:18 PDT
Size:
11.04 KB
patch
obsolete
>Subversion Revision: 245001 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0424c9ec70e9c0a56068721f57896aeb2774aa97..925851cfe2aa9ad454f563328c556d4a4384341c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2019-05-07 Antoine Quint <graouts@apple.com> >+ >+ [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer >+ https://bugs.webkit.org/show_bug.cgi?id=197665 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions >+ would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that >+ pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was >+ ended early and the state of touches created using UIScriptController were not in a clean state. >+ >+ We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event. >+ >+ * dom/PointerEvent.cpp: >+ (WebCore::PointerEvent::create): >+ (WebCore::PointerEvent::PointerEvent): >+ * dom/PointerEvent.h: >+ * page/PointerCaptureController.cpp: >+ (WebCore::PointerCaptureController::pointerEventWasDispatched): >+ (WebCore::PointerCaptureController::cancelPointer): >+ * page/PointerCaptureController.h: >+ > 2019-05-06 James Savage <james.savage@apple.com> > > Improve coordination for creating UIWindow instances. >diff --git a/Source/WebCore/dom/PointerEvent.cpp b/Source/WebCore/dom/PointerEvent.cpp >index b679a13a811291167c587fc1eba69a0ab7acba4c..7a18898958efed76dc6b029c24bb5e15512cf76a 100644 >--- a/Source/WebCore/dom/PointerEvent.cpp >+++ b/Source/WebCore/dom/PointerEvent.cpp >@@ -84,9 +84,9 @@ RefPtr<PointerEvent> PointerEvent::create(const MouseEvent& mouseEvent) > return adoptRef(*new PointerEvent(type, canBubble, isCancelable, isComposed, mouseEvent)); > } > >-Ref<PointerEvent> PointerEvent::create(const String& type, PointerID pointerId, const String& pointerType) >+Ref<PointerEvent> PointerEvent::create(const String& type, PointerID pointerId, const String& pointerType, IsPrimary isPrimary) > { >- return adoptRef(*new PointerEvent(type, CanBubble::Yes, IsCancelable::No, IsComposed::Yes, pointerId, pointerType)); >+ return adoptRef(*new PointerEvent(type, CanBubble::Yes, IsCancelable::No, IsComposed::Yes, pointerId, pointerType, isPrimary)); > } > > PointerEvent::PointerEvent() = default; >@@ -112,10 +112,11 @@ PointerEvent::PointerEvent(const AtomicString& type, CanBubble canBubble, IsCanc > { > } > >-PointerEvent::PointerEvent(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, PointerID pointerId, const String& pointerType) >+PointerEvent::PointerEvent(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, PointerID pointerId, const String& pointerType, IsPrimary isPrimary) > : MouseEvent(type, canBubble, isCancelable, isComposed, nullptr, 0, { }, { }, { }, 0, 0, 0, nullptr) > , m_pointerId(pointerId) > , m_pointerType(pointerType) >+ , m_isPrimary(isPrimary == IsPrimary::Yes) > { > } > >diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h >index b12ab2d788dd5b52e1f24833edcfa79235b7e2f5..d51de26c30d69c953f053467d0d88876ccd1115d 100644 >--- a/Source/WebCore/dom/PointerEvent.h >+++ b/Source/WebCore/dom/PointerEvent.h >@@ -52,6 +52,8 @@ public: > bool isPrimary { false }; > }; > >+ enum class IsPrimary : uint8_t { No, Yes }; >+ > static Ref<PointerEvent> create(const AtomicString& type, Init&& initializer) > { > return adoptRef(*new PointerEvent(type, WTFMove(initializer))); >@@ -73,7 +75,7 @@ public: > } > > static RefPtr<PointerEvent> create(const MouseEvent&); >- static Ref<PointerEvent> create(const String& type, PointerID, const String& pointerType); >+ static Ref<PointerEvent> create(const String& type, PointerID, const String& pointerType, IsPrimary = IsPrimary::No); > > #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY) > static Ref<PointerEvent> create(const PlatformTouchEvent&, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&&); >@@ -106,7 +108,7 @@ private: > PointerEvent(); > PointerEvent(const AtomicString&, Init&&); > PointerEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, const MouseEvent&); >- PointerEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, PointerID, const String& pointerType); >+ PointerEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, PointerID, const String& pointerType, IsPrimary); > #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY) > PointerEvent(const AtomicString& type, const PlatformTouchEvent&, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&&); > #endif >diff --git a/Source/WebCore/page/PointerCaptureController.cpp b/Source/WebCore/page/PointerCaptureController.cpp >index a071e7a5ec67ec620141375c4510610cd874edd4..a0fd0871a860e0171c1a1c1ce8e0fc98d5b4a675 100644 >--- a/Source/WebCore/page/PointerCaptureController.cpp >+++ b/Source/WebCore/page/PointerCaptureController.cpp >@@ -234,6 +234,8 @@ void PointerCaptureController::pointerEventWasDispatched(const PointerEvent& eve > auto iterator = m_activePointerIdsToCapturingData.find(event.pointerId()); > if (iterator != m_activePointerIdsToCapturingData.end()) { > auto& capturingData = iterator->value; >+ capturingData.isPrimary = event.isPrimary(); >+ > // Immediately after firing the pointerup or pointercancel events, a user agent MUST clear the pending pointer capture target > // override for the pointerId of the pointerup or pointercancel event that was just dispatched, and then run Process Pending > // Pointer Capture steps to fire lostpointercapture if necessary. >@@ -281,7 +283,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint > if (!target) > return; > >- auto event = PointerEvent::create(eventNames().pointercancelEvent, pointerId, capturingData.pointerType); >+ auto event = PointerEvent::create(eventNames().pointercancelEvent, pointerId, capturingData.pointerType, capturingData.isPrimary ? PointerEvent::IsPrimary::Yes : PointerEvent::IsPrimary::No); > target->dispatchEvent(event); > processPendingPointerCapture(WTFMove(event)); > } >diff --git a/Source/WebCore/page/PointerCaptureController.h b/Source/WebCore/page/PointerCaptureController.h >index db3f7b8a3e48c0ae7b7cdadb31968945f41fcd45..ab8279de93919b32f3903086be1f42c6243b5aad 100644 >--- a/Source/WebCore/page/PointerCaptureController.h >+++ b/Source/WebCore/page/PointerCaptureController.h >@@ -63,6 +63,7 @@ private: > RefPtr<Element> targetOverride; > String pointerType; > bool cancelled { false }; >+ bool isPrimary { false }; > }; > > void pointerEventWillBeDispatched(const PointerEvent&, EventTarget*); >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index e000a4bc0facda43e50c2b559c14cea4b16fb351..87f2f52827ca8b2fa80f86b4d1b84054a3613296 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-07 Antoine Quint <graouts@apple.com> >+ >+ [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer >+ https://bugs.webkit.org/show_bug.cgi?id=197665 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Record WPT progressions. >+ >+ * web-platform-tests/pointerevents/pointerevent_pointercancel_touch-expected.txt: >+ > 2019-05-03 Youenn Fablet <youenn@apple.com> > > LayoutTest imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm is a flaky failure >diff --git a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch-expected.txt >index edc0cbbda53deaae7ea6e12fd27867c3628ea625..3be427118bf94bd91dffdf74a02c00625a0da64f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointercancel_touch-expected.txt >@@ -11,5 +11,43 @@ Pointer Events pointercancel Tests > The following pointer types were detected: touch. > > >-FAIL pointercancel event received assert_equals: isPrimary should be the same for pointerdown and pointercancel expected true but got false >+FAIL pointercancel event received assert_true: pointerleave should be received before the test finished expected true got false >+PASS touch pointercancel event is a PointerEvent event >+PASS touch pointercancel.pointerId attribute exists >+PASS touch pointercancel.pointerId is readonly >+PASS touch pointercancel.pointerId IDL type long (JS type was number) >+PASS touch pointercancel.width attribute exists >+PASS touch pointercancel.width is readonly >+PASS touch pointercancel.width IDL type float (JS type was number) >+PASS touch pointercancel.height attribute exists >+PASS touch pointercancel.height is readonly >+PASS touch pointercancel.height IDL type float (JS type was number) >+PASS touch pointercancel.pressure attribute exists >+PASS touch pointercancel.pressure is readonly >+PASS touch pointercancel.pressure IDL type float (JS type was number) >+PASS touch pointercancel.tiltX attribute exists >+PASS touch pointercancel.tiltX is readonly >+PASS touch pointercancel.tiltX IDL type long (JS type was number) >+PASS touch pointercancel.tiltY attribute exists >+PASS touch pointercancel.tiltY is readonly >+PASS touch pointercancel.tiltY IDL type long (JS type was number) >+PASS touch pointercancel.pointerType attribute exists >+PASS touch pointercancel.pointerType is readonly >+PASS touch pointercancel.pointerType IDL type string (JS type was string) >+PASS touch pointercancel.isPrimary attribute exists >+PASS touch pointercancel.isPrimary is readonly >+PASS touch pointercancel.isPrimary IDL type boolean (JS type was boolean) >+PASS touch pointercancel.detail attribute exists >+PASS touch pointercancel.detail is readonly >+PASS touch pointercancel.detail IDL type long (JS type was number) >+PASS touch pointercancel.detail value is 0. >+PASS touch pointercancel.fromElement attribute exists >+PASS touch pointercancel.fromElement is readonly >+PASS touch pointercancel.fromElement IDL type object (JS type was object) >+PASS touch pointercancel.fromElement value is null. >+PASS touch pointercancel.toElement attribute exists >+PASS touch pointercancel.toElement is readonly >+PASS touch pointercancel.toElement IDL type object (JS type was object) >+FAIL touch pointercancel.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0" style="background: black"></div> >+PASS touch pointercancel.pressure value is valid >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197665
: 369296