[Pointer Events] toElement and fromElement should be null
https://bugs.webkit.org/show_bug.cgi?id=198338
Patch by Antoine Quint <graouts@apple.com> 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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@245867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h
index 3da0f93..9b603b6 100644
--- a/Source/WebCore/dom/PointerEvent.h
+++ b/Source/WebCore/dom/PointerEvent.h
@@ -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: