Title: [245867] trunk
Revision
245867
Author
[email protected]
Date
2019-05-29 14:04:55 -0700 (Wed, 29 May 2019)

Log Message

[Pointer Events] toElement and fromElement should be null
https://bugs.webkit.org/show_bug.cgi?id=198338

Patch by Antoine Quint <[email protected]> on 2019-05-29
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions now that we return the correct values for toElement and fromElement.

* web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt:
* web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt:

Source/WebCore:

* dom/MouseEvent.h:
* dom/PointerEvent.h:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (245866 => 245867)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-05-29 20:45:11 UTC (rev 245866)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-05-29 21:04:55 UTC (rev 245867)
@@ -1,3 +1,15 @@
+2019-05-29  Antoine Quint  <[email protected]>
+
+        [Pointer Events] toElement and fromElement should be null
+        https://bugs.webkit.org/show_bug.cgi?id=198338
+
+        Reviewed by Dean Jackson.
+
+        Mark WPT progressions now that we return the correct values for toElement and fromElement.
+
+        * web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt:
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt:
+
 2019-05-28  Shawn Roberts  <[email protected]>
 
         Unreviewed, rolling out r245475.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt (245866 => 245867)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt	2019-05-29 20:45:11 UTC (rev 245866)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt	2019-05-29 21:04:55 UTC (rev 245867)
@@ -47,7 +47,7 @@
 PASS  mouse pointerenter.toElement attribute exists 
 PASS  mouse pointerenter.toElement is readonly 
 PASS  mouse pointerenter.toElement IDL type object (JS type was object) 
-FAIL  mouse pointerenter.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0"></div>
+PASS  mouse pointerenter.toElement value is null. 
 PASS  mouse pointerenter.pressure value is valid 
 PASS  mouse pointerenter properties for pointerType = mouse 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt (245866 => 245867)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt	2019-05-29 20:45:11 UTC (rev 245866)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt	2019-05-29 21:04:55 UTC (rev 245867)
@@ -43,12 +43,11 @@
 PASS  mouse pointerleave.fromElement attribute exists 
 PASS  mouse pointerleave.fromElement is readonly 
 PASS  mouse pointerleave.fromElement IDL type object (JS type was object) 
-FAIL  mouse pointerleave.fromElement value is null. assert_equals: fromElement attribute value expected null but got Element node <html><head>
-        <title>Pointer Event: The pointerlea...
+PASS  mouse pointerleave.fromElement value is null. 
 PASS  mouse pointerleave.toElement attribute exists 
 PASS  mouse pointerleave.toElement is readonly 
 PASS  mouse pointerleave.toElement IDL type object (JS type was object) 
-FAIL  mouse pointerleave.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0"></div>
+PASS  mouse pointerleave.toElement value is null. 
 PASS  mouse pointerleave.pressure value is valid 
 PASS  mouse pointerleave properties for pointerType = mouse 
 

Modified: trunk/Source/WebCore/ChangeLog (245866 => 245867)


--- trunk/Source/WebCore/ChangeLog	2019-05-29 20:45:11 UTC (rev 245866)
+++ trunk/Source/WebCore/ChangeLog	2019-05-29 21:04:55 UTC (rev 245867)
@@ -1,3 +1,13 @@
+2019-05-29  Antoine Quint  <[email protected]>
+
+        [Pointer Events] toElement and fromElement should be null
+        https://bugs.webkit.org/show_bug.cgi?id=198338
+
+        Reviewed by Dean Jackson.
+
+        * dom/MouseEvent.h:
+        * dom/PointerEvent.h:
+
 2019-05-29  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r245857.

Modified: trunk/Source/WebCore/dom/MouseEvent.h (245866 => 245867)


--- trunk/Source/WebCore/dom/MouseEvent.h	2019-05-29 20:45:11 UTC (rev 245866)
+++ trunk/Source/WebCore/dom/MouseEvent.h	2019-05-29 21:04:55 UTC (rev 245867)
@@ -75,8 +75,8 @@
     double force() const { return m_force; }
     void setForce(double force) { m_force = force; }
 
-    WEBCORE_EXPORT RefPtr<Node> toElement() const;
-    WEBCORE_EXPORT RefPtr<Node> fromElement() const;
+    WEBCORE_EXPORT virtual RefPtr<Node> toElement() const;
+    WEBCORE_EXPORT virtual RefPtr<Node> fromElement() const;
 
     DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.get() : nullptr; }
 

Modified: trunk/Source/WebCore/dom/PointerEvent.h (245866 => 245867)


--- trunk/Source/WebCore/dom/PointerEvent.h	2019-05-29 20:45:11 UTC (rev 245866)
+++ trunk/Source/WebCore/dom/PointerEvent.h	2019-05-29 21:04:55 UTC (rev 245867)
@@ -28,6 +28,7 @@
 #if ENABLE(POINTER_EVENTS)
 
 #include "MouseEvent.h"
+#include "Node.h"
 #include "PointerID.h"
 #include <wtf/text/WTFString.h>
 
@@ -101,6 +102,14 @@
 
     bool isPointerEvent() const final { return true; }
 
+    // https://w3c.github.io/pointerevents/#attributes-and-default-actions
+    // Many user agents expose non-standard attributes fromElement and toElement in MouseEvents to
+    // support legacy content. In those user agents, the values of those (inherited) attributes in
+    // PointerEvents must be null to encourage the use of the standardized alternates (i.e. target
+    // and relatedTarget).
+    RefPtr<Node> toElement() const final { return nullptr; }
+    RefPtr<Node> fromElement() const final { return nullptr; }
+
     EventInterface eventInterface() const override;
 
 private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to