diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-25 01:03:57 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-25 01:03:57 +0000 |
commit | ceadffab6b357723981a429e11222daf6cd6dcfb (patch) | |
tree | 5603053048d6a460f79b22bdf165fb74d32d39b0 /testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html | |
parent | 14fb2f966e9b54598c451e3cb35b4aa0480dafed (diff) | |
parent | ad5a13bd501e379517da1a944c104a11d951a3f5 (diff) | |
download | UXP-RC_20210225.tar UXP-RC_20210225.tar.gz UXP-RC_20210225.tar.lz UXP-RC_20210225.tar.xz UXP-RC_20210225.zip |
Merge branch 'master' into releaseRC_20210225
Diffstat (limited to 'testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html')
-rw-r--r-- | testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html b/testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html deleted file mode 100644 index b325d5c5d..000000000 --- a/testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html +++ /dev/null @@ -1,92 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<title> Dispatch additional events inside an event listener </title> -<link rel="help" href="https://dom.spec.whatwg.org/#concept-event-dispatch"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<div id=log></div> - -<table id="table" border="1" style="display: none"> - <tbody id="table-body"> - <tr id="table-row"> - <td id="table-cell">Shady Grove</td> - <td>Aeolian</td> - </tr> - <tr id="parent"> - <td id="target">Over the river, Charlie</td> - <td>Dorian</td> - </tr> - </tbody> -</table> - -<script> -async_test(function() { - var event_type = "bar"; - var target = document.getElementById("target"); - var parent = document.getElementById("parent"); - var tbody = document.getElementById("table-body"); - var table = document.getElementById("table"); - var body = document.body; - var html = document.documentElement; - var targets = [window, document, html, body, table, tbody, parent, target]; - var expected_targets = [ - window, - document, - html, - body, - table, - tbody, - parent, - target, - target, - parent, - tbody, - table, - body, - html, - document, - window - ]; - var expected_listeners = [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]; - - var actual_targets = [], actual_listeners = []; - var test_event_function = function(i) { - return this.step_func(function(evt) { - actual_targets.push(evt.currentTarget); - actual_listeners.push(i); - - if (evt.eventPhase != evt.BUBBLING_PHASE && evt.currentTarget.foo != 1) { - evt.currentTarget.removeEventListener(event_type, event_handlers[0], true); - evt.currentTarget.addEventListener(event_type, event_handlers[2], true); - evt.currentTarget.foo = 1; - } - - if (evt.eventPhase != evt.CAPTURING_PHASE && evt.currentTarget.foo != 3) { - evt.currentTarget.removeEventListener(event_type, event_handlers[0], false); - evt.currentTarget.addEventListener(event_type, event_handlers[3], false); - evt.currentTarget.foo = 3; - } - }); - }.bind(this); - var event_handlers = [ - test_event_function(0), - test_event_function(1), - test_event_function(2), - test_event_function(3), - ]; - - for (var i = 0; i < targets.length; ++i) { - targets[i].addEventListener(event_type, event_handlers[0], true); - targets[i].addEventListener(event_type, event_handlers[1], false); - } - - var evt = document.createEvent("Event"); - evt.initEvent(event_type, true, true); - target.dispatchEvent(evt); - - assert_array_equals(actual_targets, expected_targets, "actual_targets"); - assert_array_equals(actual_listeners, expected_listeners, "actual_listeners"); - - this.done(); -}); -</script> |