Changeset 200580 in webkit


Ignore:
Timestamp:
May 9, 2016 10:47:01 AM (8 years ago)
Author:
rniwa@webkit.org
Message:

REGRESSION (198056): Unable to use edit buttons on WordPress
https://bugs.webkit.org/show_bug.cgi?id=157475

Reviewed by Antti Koivisto.

Source/WebCore:

Renamed Event.prototype.deepPath() to composedPath() per discussions on
https://github.com/whatwg/dom/issues/242 as the old name was not Web compatible.

Test: fast/shadow-dom/Extensions-to-Event-Interface.html

  • dom/Event.cpp:

(WebCore::Event::composedPath): Renamed from deepPath.

  • dom/Event.h:
  • dom/Event.idl:

LayoutTests:

Updated the tests.

  • fast/shadow-dom/Extensions-to-Event-Interface-expected.txt:
  • fast/shadow-dom/Extensions-to-Event-Interface.html:
  • fast/shadow-dom/resources/event-path-test-helpers.js:

(dispatchEventWithLog):

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r200579 r200580  
     12016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION (198056): Unable to use edit buttons on WordPress
     4        https://bugs.webkit.org/show_bug.cgi?id=157475
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Updated the tests.
     9
     10        * fast/shadow-dom/Extensions-to-Event-Interface-expected.txt:
     11        * fast/shadow-dom/Extensions-to-Event-Interface.html:
     12        * fast/shadow-dom/resources/event-path-test-helpers.js:
     13        (dispatchEventWithLog):
     14
    1152016-05-09  Ryan Haddad  <ryanhaddad@apple.com>
    216
  • trunk/LayoutTests/fast/shadow-dom/Extensions-to-Event-Interface-expected.txt

    r198056 r200580  
    11
    2 PASS deepPath() must exist on Event
    3 PASS deepPath() must return an empty array when the event has not been dispatched
    4 PASS deepPath() must return an empty array when the event is no longer dispatched
     2PASS composedPath() must exist on Event
     3PASS composedPath() must return an empty array when the event has not been dispatched
     4PASS composedPath() must return an empty array when the event is no longer dispatched
    55PASS scoped must exist on Event
    66PASS scoped on EventInit must default to false
     
    2121PASS The event must propagate out of open mode shadow tree in which the relative target and the relative related target are the same
    2222PASS The event must propagate out of closed mode shadow tree in which the relative target and the relative related target are the same
    23 PASS deepPath() must contain and only contain the unclosed nodes of target in open mode shadow trees
    24 PASS deepPath() must contain and only contain the unclosed nodes of target in closed mode shadow trees
     23PASS composedPath() must contain and only contain the unclosed nodes of target in open mode shadow trees
     24PASS composedPath() must contain and only contain the unclosed nodes of target in closed mode shadow trees
    2525
  • trunk/LayoutTests/fast/shadow-dom/Extensions-to-Event-Interface.html

    r198056 r200580  
    44<title>Shadow DOM: Extensions to Event Interface</title>
    55<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
    6 <meta name="assert" content="Event interface must have deepPath() as a method">
     6<meta name="assert" content="Event interface must have composedPath() as a method">
    77<link rel="help" href="http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface">
    88<script src="../../resources/testharness.js"></script>
     
    1616
    1717test(function () {
    18     assert_true('deepPath' in Event.prototype);
    19     assert_true('deepPath' in new Event('my-event'));
    20 }, 'deepPath() must exist on Event');
    21 
    22 test(function () {
    23     var event = new Event('my-event');
    24     assert_array_equals(event.deepPath(), []);
    25 }, 'deepPath() must return an empty array when the event has not been dispatched');
     18    assert_true('composedPath' in Event.prototype);
     19    assert_true('composedPath' in new Event('my-event'));
     20}, 'composedPath() must exist on Event');
     21
     22test(function () {
     23    var event = new Event('my-event');
     24    assert_array_equals(event.composedPath(), []);
     25}, 'composedPath() must return an empty array when the event has not been dispatched');
    2626
    2727test(function () {
    2828    var event = new Event('my-event');
    2929    document.body.dispatchEvent(event);
    30     assert_array_equals(event.deepPath(), []);
    31 }, 'deepPath() must return an empty array when the event is no longer dispatched');
     30    assert_array_equals(event.composedPath(), []);
     31}, 'composedPath() must return an empty array when the event is no longer dispatched');
    3232
    3333test(function () {
     
    8888        assert_array_equals(log.pathAtTargets[1], expectedPath);
    8989        assert_array_equals(log.pathAtTargets[2], mode == 'open' ? expectedPath : ['A1', 'A-SR', 'A'],
    90             'deepPath must only contain unclosed nodes of the current target.');
     90            'composedPath must only contain unclosed nodes of the current target.');
    9191    }, 'The event must propagate out of ' + mode + ' mode shadow boundaries when the scoped flag is unset');
    9292}
     
    275275        assert_array_equals(log.pathAtTargets[8], mode == 'open' ? expectedPath : pathExposedToB);
    276276        assert_array_equals(log.relatedTargets, expectedRelatedTarget);
    277     }, 'deepPath() must contain and only contain the unclosed nodes of target in ' + mode + ' mode shadow trees');
     277    }, 'composedPath() must contain and only contain the unclosed nodes of target in ' + mode + ' mode shadow trees');
    278278}
    279279
  • trunk/LayoutTests/fast/shadow-dom/resources/event-path-test-helpers.js

    r198056 r200580  
    1616                relatedTargets.push(event.relatedTarget ? event.relatedTarget.label : null);
    1717
    18                 if (!event.deepPath) // Don't fail all tests just for the lack of deepPath.
     18                if (!event.composedPath) // Don't fail all tests just for the lack of composedPath.
    1919                    return;
    2020
    21                 pathAtTargets.push(event.deepPath().map(function (node) { return node.label; }));
     21                pathAtTargets.push(event.composedPath().map(function (node) { return node.label; }));
    2222            }).bind(node));
    2323        }
  • trunk/Source/WebCore/ChangeLog

    r200578 r200580  
     12016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION (198056): Unable to use edit buttons on WordPress
     4        https://bugs.webkit.org/show_bug.cgi?id=157475
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Renamed Event.prototype.deepPath() to composedPath() per discussions on
     9        https://github.com/whatwg/dom/issues/242 as the old name was not Web compatible.
     10
     11        Test: fast/shadow-dom/Extensions-to-Event-Interface.html
     12
     13        * dom/Event.cpp:
     14        (WebCore::Event::composedPath): Renamed from deepPath.
     15        * dom/Event.h:
     16        * dom/Event.idl:
     17
    1182016-05-09  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/Source/WebCore/dom/Event.cpp

    r200464 r200580  
    188188}
    189189
    190 Vector<EventTarget*> Event::deepPath() const
     190Vector<EventTarget*> Event::composedPath() const
    191191{
    192192    if (!m_eventPath)
  • trunk/Source/WebCore/dom/Event.h

    r198056 r200580  
    125125    void setEventPath(const EventPath& path) { m_eventPath = &path; }
    126126    void clearEventPath() { m_eventPath = nullptr; }
    127     Vector<EventTarget*> deepPath() const;
     127    Vector<EventTarget*> composedPath() const;
    128128
    129129    void stopPropagation() { m_propagationStopped = true; }
  • trunk/Source/WebCore/dom/Event.idl

    r199969 r200580  
    6262    readonly attribute DOMTimeStamp     timeStamp;
    6363
    64     [Conditional=SHADOW_DOM, EnabledAtRuntime=ShadowDOM] sequence<Node> deepPath();
     64    [Conditional=SHADOW_DOM, EnabledAtRuntime=ShadowDOM] sequence<Node> composedPath();
    6565
    6666    void               stopPropagation();
Note: See TracChangeset for help on using the changeset viewer.