Bug 1444857 [wpt PR 9968] - DOM: test composed/composedPath via IDL, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Fri, 27 Apr 2018 20:46:32 +0000
changeset 472282 bfcaffd393b7fb32108fb81f092f6bcef8cd24b9
parent 472281 c9385158fbe9f6e15d7d169ef9c5b268cbda7fb2
child 472283 87664c18684377d75118ba5eee951447ed60178c
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1444857
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1444857 [wpt PR 9968] - DOM: test composed/composedPath via IDL, a=testonly Automatic update from web-platform-testsDOM: test composed/composedPath via IDL (#9968) -- wpt-commits: a4c4257d4c6df3000aad94b0c3ae1afc7c5aa5c6 wpt-pr: 9968
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/interfaces/dom.idl
testing/web-platform/tests/shadow-dom/Extensions-to-Event-Interface.html
testing/web-platform/tests/shadow-dom/resources/event-path-test-helpers.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -577403,17 +577403,17 @@
    "3a1097a8c4cb4f63da97e126fbb302a5fec73968",
    "support"
   ],
   "interfaces/dedicated-workers.idl": [
    "993f3d3b4fa58585c444a76d2a5fc9f388e65999",
    "support"
   ],
   "interfaces/dom.idl": [
-   "a5360a145bb075bdde49f875615f118198b9cf01",
+   "86ea69e6432ac3e4172129591f4aeac69e336a82",
    "support"
   ],
   "interfaces/encoding.idl": [
    "0dd77d1c6d854b0bdd003107c2385a224e1953f8",
    "support"
   ],
   "interfaces/encrypted-media.idl": [
    "ef1f1432c42fc6d01f3bfbd576fa5c7de349de96",
@@ -599743,17 +599743,17 @@
    "e5b4dedaf8f78a6ce771af4509da8acb3aca3441",
    "testharness"
   ],
   "shadow-dom/Element-interface-shadowRoot-attribute.html": [
    "9309a89a4cf31421a4d6adb17134f9179613d9be",
    "testharness"
   ],
   "shadow-dom/Extensions-to-Event-Interface.html": [
-   "b8a8b22197eb1c17e9cea05c73826211dd2f2532",
+   "97c54c56d053c7d7116a5c16fed6457011060d06",
    "testharness"
   ],
   "shadow-dom/HTMLSlotElement-interface.html": [
    "f30eff6f08f3680d8640aa5df2612f0fbd98dc50",
    "testharness"
   ],
   "shadow-dom/MouseEvent-prototype-offsetX-offsetY.html": [
    "8fe2c9531f1d7f98947dc3d8f6a064401e4d44f9",
@@ -599839,17 +599839,17 @@
    "51a23151c28992fe062b36914463de216bd55fbe",
    "support"
   ],
   "shadow-dom/resources/Document-prototype-currentScript-helper.js": [
    "f7d4af7942bcd858df4a2f1a8bbda86b32baee31",
    "support"
   ],
   "shadow-dom/resources/event-path-test-helpers.js": [
-   "0b3340091c93e37362c5008fded9ac4efd042f35",
+   "8eb117fa5a60279eb58b4987fb156f67a75ad136",
    "support"
   ],
   "shadow-dom/resources/shadow-dom-utils.js": [
    "05a7ed192e44934cb04bc9105d70d3dd8b2a5a28",
    "support"
   ],
   "shadow-dom/resources/shadow-dom.js": [
    "93ca8358ed39d8236a35bf823e4db3a8a53f0e2e",
--- a/testing/web-platform/tests/interfaces/dom.idl
+++ b/testing/web-platform/tests/interfaces/dom.idl
@@ -1,30 +1,32 @@
 [Constructor(DOMString type, optional EventInit eventInitDict),
  Exposed=(Window,Worker)]
 interface Event {
   readonly attribute DOMString type;
   readonly attribute EventTarget? target;
   readonly attribute EventTarget? srcElement;
   readonly attribute EventTarget? currentTarget;
+  sequence<EventTarget> composedPath();
 
   const unsigned short NONE = 0;
   const unsigned short CAPTURING_PHASE = 1;
   const unsigned short AT_TARGET = 2;
   const unsigned short BUBBLING_PHASE = 3;
   readonly attribute unsigned short eventPhase;
 
   void stopPropagation();
   void stopImmediatePropagation();
 
   readonly attribute boolean bubbles;
   readonly attribute boolean cancelable;
            attribute boolean returnValue;
   void preventDefault();
   readonly attribute boolean defaultPrevented;
+  readonly attribute boolean composed;
 
   [Unforgeable] readonly attribute boolean isTrusted;
   readonly attribute DOMTimeStamp timeStamp;
 
   void initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false);
 };
 
 dictionary EventInit {
--- a/testing/web-platform/tests/shadow-dom/Extensions-to-Event-Interface.html
+++ b/testing/web-platform/tests/shadow-dom/Extensions-to-Event-Interface.html
@@ -9,37 +9,27 @@
 <script src="/resources/testharnessreport.js"></script>
 <script src="resources/event-path-test-helpers.js"></script>
 </head>
 <body>
 <div id="log"></div>
 <script>
 
 test(function () {
-    assert_true('composedPath' in Event.prototype);
-    assert_true('composedPath' in new Event('my-event'));
-}, 'composedPath() must exist on Event');
-
-test(function () {
     var event = new Event('my-event');
     assert_array_equals(event.composedPath(), []);
 }, 'composedPath() must return an empty array when the event has not been dispatched');
 
 test(function () {
     var event = new Event('my-event');
     document.body.dispatchEvent(event);
     assert_array_equals(event.composedPath(), []);
 }, 'composedPath() must return an empty array when the event is no longer dispatched');
 
 test(function () {
-    assert_true('composed' in Event.prototype);
-    assert_true('composed' in new Event('my-event'));
-}, 'composed must exist on Event');
-
-test(function () {
     var event = new Event('my-event');
     assert_false(event.composed);
 }, 'composed on EventInit must default to false');
 
 test(function () {
     var event = new Event('my-event', {composed: true});
     assert_true(event.composed);
 
--- a/testing/web-platform/tests/shadow-dom/resources/event-path-test-helpers.js
+++ b/testing/web-platform/tests/shadow-dom/resources/event-path-test-helpers.js
@@ -11,19 +11,16 @@ function dispatchEventWithEventLog(shado
         for (var node = startingNode; node; node = node.parentNode) {
             if (attachedNodes.indexOf(node) >= 0)
                 continue;
             attachedNodes.push(node);
             node.addEventListener(event.type, (function (event) {
                 eventPath.push(this.label);
                 relatedTargets.push(event.relatedTarget ? event.relatedTarget.label : null);
 
-                if (!event.composedPath) // Don't fail all tests just for the lack of composedPath.
-                    return;
-
                 pathAtTargets.push(event.composedPath().map(function (node) { return node.label; }));
                 targets.push(event.target);
             }).bind(node));
         }
     }
 
     target.dispatchEvent(event);