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

Changeset 245867 in webkit


Ignore:
Timestamp:
May 29, 2019, 2:04:55 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Antoine Quint <Antoine Quint> 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:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r245825 r245867  
     12019-05-29  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events] toElement and fromElement should be null
     4        https://bugs.webkit.org/show_bug.cgi?id=198338
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions now that we return the correct values for toElement and fromElement.
     9
     10        * web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt:
     11        * web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt:
     12
    1132019-05-28  Shawn Roberts  <sroberts@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt

    r244393 r245867  
    4848PASS  mouse pointerenter.toElement is readonly
    4949PASS  mouse pointerenter.toElement IDL type object (JS type was object)
    50 FAIL  mouse pointerenter.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0"></div>
     50PASS  mouse pointerenter.toElement value is null.
    5151PASS  mouse pointerenter.pressure value is valid
    5252PASS  mouse pointerenter properties for pointerType = mouse
  • trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt

    r244393 r245867  
    4444PASS  mouse pointerleave.fromElement is readonly
    4545PASS  mouse pointerleave.fromElement IDL type object (JS type was object)
    46 FAIL  mouse pointerleave.fromElement value is null. assert_equals: fromElement attribute value expected null but got Element node <html><head>
    47         <title>Pointer Event: The pointerlea...
     46PASS  mouse pointerleave.fromElement value is null.
    4847PASS  mouse pointerleave.toElement attribute exists
    4948PASS  mouse pointerleave.toElement is readonly
    5049PASS  mouse pointerleave.toElement IDL type object (JS type was object)
    51 FAIL  mouse pointerleave.toElement value is null. assert_equals: toElement attribute value expected null but got Element node <div id="target0"></div>
     50PASS  mouse pointerleave.toElement value is null.
    5251PASS  mouse pointerleave.pressure value is valid
    5352PASS  mouse pointerleave properties for pointerType = mouse
  • trunk/Source/WebCore/ChangeLog

    r245863 r245867  
     12019-05-29  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events] toElement and fromElement should be null
     4        https://bugs.webkit.org/show_bug.cgi?id=198338
     5
     6        Reviewed by Dean Jackson.
     7
     8        * dom/MouseEvent.h:
     9        * dom/PointerEvent.h:
     10
    1112019-05-29  Ryan Haddad  <ryanhaddad@apple.com>
    212
  • trunk/Source/WebCore/dom/MouseEvent.h

    r244115 r245867  
    7676    void setForce(double force) { m_force = force; }
    7777
    78     WEBCORE_EXPORT RefPtr<Node> toElement() const;
    79     WEBCORE_EXPORT RefPtr<Node> fromElement() const;
     78    WEBCORE_EXPORT virtual RefPtr<Node> toElement() const;
     79    WEBCORE_EXPORT virtual RefPtr<Node> fromElement() const;
    8080
    8181    DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.get() : nullptr; }
  • trunk/Source/WebCore/dom/PointerEvent.h

    r245639 r245867  
    2929
    3030#include "MouseEvent.h"
     31#include "Node.h"
    3132#include "PointerID.h"
    3233#include <wtf/text/WTFString.h>
     
    102103    bool isPointerEvent() const final { return true; }
    103104
     105    // https://w3c.github.io/pointerevents/#attributes-and-default-actions
     106    // Many user agents expose non-standard attributes fromElement and toElement in MouseEvents to
     107    // support legacy content. In those user agents, the values of those (inherited) attributes in
     108    // PointerEvents must be null to encourage the use of the standardized alternates (i.e. target
     109    // and relatedTarget).
     110    RefPtr<Node> toElement() const final { return nullptr; }
     111    RefPtr<Node> fromElement() const final { return nullptr; }
     112
    104113    EventInterface eventInterface() const override;
    105114
Note: See TracChangeset for help on using the changeset viewer.