diff options
Diffstat (limited to 'dom/tests/mochitest')
-rw-r--r-- | dom/tests/mochitest/chrome/child_focus_frame.html | 2 | ||||
-rw-r--r-- | dom/tests/mochitest/chrome/file_bug800817.xhtml | 11 | ||||
-rw-r--r-- | dom/tests/mochitest/chrome/test_bug800817.xhtml | 10 | ||||
-rw-r--r-- | dom/tests/mochitest/chrome/window_focus.xhtml | 57 | ||||
-rw-r--r-- | dom/tests/mochitest/general/mochitest.toml | 8 | ||||
-rw-r--r-- | dom/tests/mochitest/general/test_focus_scrollchildframe.html | 12 | ||||
-rw-r--r-- | dom/tests/mochitest/general/test_interfaces.js | 40 | ||||
-rw-r--r-- | dom/tests/mochitest/webcomponents/mochitest.toml | 2 | ||||
-rw-r--r-- | dom/tests/mochitest/webcomponents/test_event_stopping.html | 174 |
9 files changed, 88 insertions, 228 deletions
diff --git a/dom/tests/mochitest/chrome/child_focus_frame.html b/dom/tests/mochitest/chrome/child_focus_frame.html index d7f0ff63cd..89e9b8aae1 100644 --- a/dom/tests/mochitest/chrome/child_focus_frame.html +++ b/dom/tests/mochitest/chrome/child_focus_frame.html @@ -43,8 +43,8 @@ <fieldset style="float: right;"> <legend id="legend">Options</legend> <input id="t28" type="radio" name="options" value="optionone">One - <label id="ad" accesskey="d">Label:<input id="t29" type="radio" name="options" value="optiontwo">Two</label> </fieldset> +<label id="ad" accesskey="d">Label:<input id="t29" type="radio" name="options2" value="optiontwo">Two</label> <div id="t30" tabindex="0">abc</div> <input id="o18" accesskey="u" disabled size="3"/> <label id="ag" accesskey="g" for="n6">L</label> diff --git a/dom/tests/mochitest/chrome/file_bug800817.xhtml b/dom/tests/mochitest/chrome/file_bug800817.xhtml index bcd64b3ca7..ea646a74a1 100644 --- a/dom/tests/mochitest/chrome/file_bug800817.xhtml +++ b/dom/tests/mochitest/chrome/file_bug800817.xhtml @@ -30,16 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817 var b1 = document.getElementById("b1"); var b2 = document.getElementById("b2"); - var testMozBrowser = window.arguments[0].testMozBrowser; - if (testMozBrowser) { - b1.setAttribute("mozbrowser", "true"); - b2.setAttribute("mozbrowser", "true"); - } - - if (testMozBrowser) - window.arguments[0].info("Testing with mozbrowser=true"); - else - window.arguments[0].info("Testing without mozbrowser"); + window.arguments[0].info("Testing..."); b1.contentWindow.focus(); window.arguments[0].is(document.activeElement, b1, diff --git a/dom/tests/mochitest/chrome/test_bug800817.xhtml b/dom/tests/mochitest/chrome/test_bug800817.xhtml index fefaf2c155..76ea31a2fc 100644 --- a/dom/tests/mochitest/chrome/test_bug800817.xhtml +++ b/dom/tests/mochitest/chrome/test_bug800817.xhtml @@ -20,20 +20,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817 <![CDATA[ /** Test for Bug 800817 **/ - var testMozBrowser = false; function runTests() { - // Run a first round of tests for non-mozbrowser iframes. window.openDialog("file_bug800817.xhtml", "_blank", "chrome,width=600,height=550,noopener", window); } function finishedTests() { - if (!testMozBrowser) { - testMozBrowser = true; - // Run a second round of tests for mozbrowser iframes. - window.openDialog("file_bug800817.xhtml", "_blank", "chrome,width=600,height=550,noopener", window); - } else { - SimpleTest.finish(); - } + SimpleTest.finish(); } SimpleTest.waitForExplicitFinish(); diff --git a/dom/tests/mochitest/chrome/window_focus.xhtml b/dom/tests/mochitest/chrome/window_focus.xhtml index e4cfeb6560..a1f9838450 100644 --- a/dom/tests/mochitest/chrome/window_focus.xhtml +++ b/dom/tests/mochitest/chrome/window_focus.xhtml @@ -46,6 +46,9 @@ var gChildWindow = null; var gOldExpectedWindow = null; var gNewExpectedWindow = null; +var gCanTabMoveFocusToRootElement = + !SpecialPowers.getBoolPref("dom.disable_tab_focus_to_root_element"); + function is(l, r, n) { window.arguments[0].SimpleTest.is(l,r,n); } function ok(v, n) { window.arguments[0].SimpleTest.ok(v,n); } @@ -398,8 +401,18 @@ function startTest() gLastFocusMethod = fm.FLAG_BYKEY; if (gPartialTabbing) { - var partialTabList = ["t3", "t5", "t9", "t10", "t11", "t12", "t13", "t14", "t15", - "t16", "t19", "t20", "t21", "t22", "t26", "t27", "t28", "t29", "t30"]; + var partialTabList; + if (gCanTabMoveFocusToRootElement) { + partialTabList = ["t3", "t5", "t9", "t10", "t11", "t12", "t13", "t14", "t15", + "t16", "t19", "t20", "t21", "t22", "t26", "t27", "t28", "t29", "t30"]; + } else { + // !gCanTabMoveFocusToRootElement + // t13 is the <html> element in child_focus_frame.html, + // and it's not getting the focus + // when gCanTabMoveFocusToRootElement is false. + partialTabList = ["t3", "t5", "t9", "t10", "t11", "t12", "t14", "t15", + "t16", "t19", "t20", "t21", "t22", "t26", "t27", "t28", "t29", "t30"]; + } for (var idx = 0; idx < partialTabList.length; idx++) { expectFocusShift(pressTab, null, getById(partialTabList[idx]), true, "partial tab key " + partialTabList[idx]); } @@ -415,6 +428,13 @@ function startTest() else { // TAB key for (var idx = 1; idx <= kTabbableSteps; idx++) { + if (!gCanTabMoveFocusToRootElement) { + if (idx == kChildDocumentRootIndex) + // t13 is the <html> element in child_focus_frame.html, + // and it's not getting the focus + // when gCanTabMoveFocusToRootElement is false. + continue; + } expectFocusShift(pressTab, null, getById("t" + idx), true, "tab key t" + idx); } @@ -427,6 +447,14 @@ function startTest() // Shift+TAB key setFocusTo("o5", window); for (idx = kTabbableSteps; idx > 0; idx--) { + if (!gCanTabMoveFocusToRootElement) { + if (idx == kChildDocumentRootIndex) { + // t13 is the <html> element in child_focus_frame.html, + // and it's not getting the focus + // when gCanTabMoveFocusToRootElement is false. + continue; + } + } expectFocusShift(() => synthesizeKey("KEY_Tab", {shiftKey: true}), null, getById("t" + idx), true, "shift tab key t" + idx); } @@ -1158,29 +1186,38 @@ function framesetWindowLoaded(framesetWindow) gOldExpectedWindow = getTopWindow(framesetWindow); gMoveToFocusFrame = true; - for (var idx = 1; idx <= 8; idx++) { - gNewExpectedWindow = framesetWindow.frames[(idx - 1) >> 1]; - if (idx % 2) + let steps = gCanTabMoveFocusToRootElement ? 8 : 4; + for (var idx = 1; idx <= steps; idx++) { + let frameIndex = gCanTabMoveFocusToRootElement ? (idx - 1) >> 1 : idx - 1; + gNewExpectedWindow = framesetWindow.frames[frameIndex]; + if (gCanTabMoveFocusToRootElement) { + if (idx % 2) { + initEvents(gNewExpectedWindow); + } + } else { initEvents(gNewExpectedWindow); + } expectFocusShift(() => synthesizeKey("KEY_Tab", {}, framesetWindow), - gNewExpectedWindow, getById("f" + idx), true, "frameset tab key f" + idx); + gNewExpectedWindow, getById("f" + (gCanTabMoveFocusToRootElement ? idx : idx * 2)), true, "frameset tab key f" + idx); gMoveToFocusFrame = false; gOldExpectedWindow = gNewExpectedWindow; } gNewExpectedWindow = framesetWindow.frames[0]; expectFocusShift(() => synthesizeKey("KEY_Tab", {}, framesetWindow), - gNewExpectedWindow, getById("f1"), true, "frameset tab key wrap to start"); + gNewExpectedWindow, gCanTabMoveFocusToRootElement ? getById("f1") : getById("f2"), true, "frameset tab key wrap to start"); gOldExpectedWindow = gNewExpectedWindow; gNewExpectedWindow = framesetWindow.frames[3]; expectFocusShift(() => synthesizeKey("KEY_Tab", {shiftKey: true}, framesetWindow), gNewExpectedWindow, getById("f8"), true, "frameset shift tab key wrap to end"); - for (idx = 7; idx >= 1; idx--) { + steps = gCanTabMoveFocusToRootElement ? 7 : 3; + for (idx = steps; idx >= 1; idx--) { gOldExpectedWindow = gNewExpectedWindow; - gNewExpectedWindow = framesetWindow.frames[(idx - 1) >> 1]; + let frameIndex = gCanTabMoveFocusToRootElement ? (idx - 1) >> 1 : idx - 1; + gNewExpectedWindow = framesetWindow.frames[frameIndex]; expectFocusShift(() => synthesizeKey("KEY_Tab", {shiftKey: true}, framesetWindow), - gNewExpectedWindow, getById("f" + idx), true, "frameset shift tab key f" + idx); + gNewExpectedWindow, getById("f" + (gCanTabMoveFocusToRootElement ? idx : idx * 2)), true, "frameset shift tab key f" + idx); } // document shifting diff --git a/dom/tests/mochitest/general/mochitest.toml b/dom/tests/mochitest/general/mochitest.toml index b8ec30f510..06137a8dd9 100644 --- a/dom/tests/mochitest/general/mochitest.toml +++ b/dom/tests/mochitest/general/mochitest.toml @@ -194,7 +194,7 @@ skip-if = [ ["test_resizeby.html"] skip-if = [ "os == 'android'", # Window sizes cannot be controled on android; Windows - "os == 'linux' && bits == 64",# Bug 1604152 + "os == 'linux' && os_version == '18.04' && bits == 64",# Bug 1604152 ] ["test_resource_timing.html"] @@ -261,8 +261,10 @@ skip-if = [ ["test_toggling_performance_navigation_timing.html"] skip-if = [ - "os == 'win' && bits == 64 && !debug", # Bug 1730152 - "os == 'mac' && bits == 64 && !debug", # Bug 1730152 + "win10_2009 && bits == 64 && !debug", # Bug 1730152 + "win11_2009 && bits == 64 && !debug", # Bug 1730152 + "apple_catalina && !debug", # Bug 1730152 + "apple_silicon && !debug", # Bug 1730152 ] ["test_vibrator.html"] diff --git a/dom/tests/mochitest/general/test_focus_scrollchildframe.html b/dom/tests/mochitest/general/test_focus_scrollchildframe.html index 4b12462c45..5bb13002b8 100644 --- a/dom/tests/mochitest/general/test_focus_scrollchildframe.html +++ b/dom/tests/mochitest/general/test_focus_scrollchildframe.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML> <html> <head> - <title>Tests for for-of loops</title> + <title>Test for using TAB to move focus and scroll into view</title> <script src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/tests/SimpleTest/EventUtils.js"></script> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> @@ -11,10 +11,18 @@ <div id="content" style="display: none"></div> <script> function doTest() { + var canTabMoveFocusToRootElement = + !SpecialPowers.getBoolPref("dom.disable_tab_focus_to_root_element"); document.getElementById("button").focus(); + const iframe = document.querySelector("iframe"); is(window.scrollY, 0, "Scrolled position initially 0"); synthesizeKey("KEY_Tab"); - ok(window.scrollY > 200, "Scrolled child frame into view"); + is(document.activeElement, iframe, "Focus moved to the iframe"); + if (canTabMoveFocusToRootElement) { + ok(window.scrollY > 200, "Scrolled child frame into view"); + } else { + is(window.scrollY, 0, "Scrolled position remained the same"); + } SimpleTest.finish(); } SimpleTest.waitForExplicitFinish(); diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index 366a9203c7..fd15348532 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -182,6 +182,10 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "AudioContext", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "AudioData", insecureContext: true, nightly: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "AudioDecoder", nightly: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! { name: "AudioBufferSourceNode", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "AudioDestinationNode", insecureContext: true }, @@ -262,11 +266,7 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "ConstantSourceNode", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { - name: "ContentVisibilityAutoStateChangeEvent", - insecureContext: true, - nightly: true, - }, + { name: "ContentVisibilityAutoStateChangeEvent", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "ConvolverNode", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! @@ -390,8 +390,6 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "DOMRectReadOnly", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "DOMRequest", insecureContext: true, disabled: true }, - // IMPORTANT: Do not change this list without review from a DOM peer! { name: "DOMStringList", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "DOMStringMap", insecureContext: true }, @@ -406,6 +404,8 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "ElementInternals", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "EncodedAudioChunk", insecureContext: true, nightly: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! { name: "EncodedVideoChunk", insecureContext: true, nightly: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "ErrorEvent", insecureContext: true }, @@ -456,23 +456,23 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "GainNode", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "Gamepad", insecureContext: false }, + { name: "Gamepad", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadAxisMoveEvent", insecureContext: false }, + { name: "GamepadAxisMoveEvent", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadButtonEvent", insecureContext: false }, + { name: "GamepadButtonEvent", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadButton", insecureContext: false }, + { name: "GamepadButton", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadEvent", insecureContext: false }, + { name: "GamepadEvent", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadHapticActuator", insecureContext: false }, + { name: "GamepadHapticActuator", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadLightIndicator", insecureContext: false, disabled: true }, + { name: "GamepadLightIndicator", insecureContext: true, disabled: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadPose", insecureContext: false }, + { name: "GamepadPose", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "GamepadTouch", insecureContext: false, disabled: true }, + { name: "GamepadTouch", insecureContext: true, disabled: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "Geolocation", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! @@ -1074,6 +1074,8 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "RTCIceCandidate", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "RTCIceTransport", insecureContext: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! { name: "RTCPeerConnection", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "RTCPeerConnectionIceEvent", insecureContext: true }, @@ -1645,7 +1647,7 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "onbeforeprint", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "onbeforetoggle", insecureContext: true, nightly: true }, + { name: "onbeforetoggle", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "onbeforeunload", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! @@ -1663,8 +1665,12 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "onclose", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "oncontextlost", insecureContext: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! { name: "oncontextmenu", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "oncontextrestored", insecureContext: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! { name: "oncopy", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "oncuechange", insecureContext: true }, diff --git a/dom/tests/mochitest/webcomponents/mochitest.toml b/dom/tests/mochitest/webcomponents/mochitest.toml index 8b9dad41d5..e43a4d1ccd 100644 --- a/dom/tests/mochitest/webcomponents/mochitest.toml +++ b/dom/tests/mochitest/webcomponents/mochitest.toml @@ -64,8 +64,6 @@ support-files = [ ["test_event_retarget.html"] -["test_event_stopping.html"] - ["test_link_prefetch.html"] ["test_shadowdom_active_pseudo_class.html"] diff --git a/dom/tests/mochitest/webcomponents/test_event_stopping.html b/dom/tests/mochitest/webcomponents/test_event_stopping.html deleted file mode 100644 index c90988d869..0000000000 --- a/dom/tests/mochitest/webcomponents/test_event_stopping.html +++ /dev/null @@ -1,174 +0,0 @@ -<!DOCTYPE HTML> -<html> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=887541 ---> -<head> - <title>Test for event model in web components</title> - <script type="text/javascript" src="head.js"></script> - <script src="/tests/SimpleTest/SimpleTest.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> -</head> -<body> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=887541">Bug 887541</a> -<script> - -var els = SpecialPowers.Cc["@mozilla.org/eventlistenerservice;1"] - .getService(SpecialPowers.Ci.nsIEventListenerService); - -SimpleTest.waitForExplicitFinish(); -createIframe() - .then((aDocument) => { - function eventListener(e) { - eventChain.push(this); - } - - function isEventChain(actual, expected, msg) { - is(actual.length, expected.length, msg); - for (var i = 0; i < expected.length; i++) { - is(actual[i], expected[i], msg + " at " + i); - } - - if (actual.length) { - var chain = els.getEventTargetChainFor(actual[0], false); // Events should be dispatched on actual[0]. - ok(expected.length < chain.length, "There should be additional chrome event targets."); - } - } - - /* - * <div elemOne> ------ <shadow-root shadowOne> - * | - * <span elemTwo> - * | - * <span elemThree> - */ - - var elemOne = aDocument.createElement("div"); - var elemTwo = aDocument.createElement("span"); - var elemThree = aDocument.createElement("span"); - var shadowOne = elemOne.attachShadow({mode: "open"}); - - shadowOne.appendChild(elemTwo); - elemTwo.appendChild(elemThree); - - // Test stopping "abort" event. - - elemOne.addEventListener("abort", eventListener); - elemTwo.addEventListener("abort", eventListener); - elemThree.addEventListener("abort", eventListener); - shadowOne.addEventListener("abort", eventListener); - - var eventChain = []; - - var customEvent = new CustomEvent("abort", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that abort event is stopped at shadow root."); - - // Test stopping "error" event. - - elemOne.addEventListener("error", eventListener); - elemTwo.addEventListener("error", eventListener); - elemThree.addEventListener("error", eventListener); - shadowOne.addEventListener("error", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("error", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that error event is stopped at shadow root."); - - // Test stopping "select" event. - - elemOne.addEventListener("select", eventListener); - elemTwo.addEventListener("select", eventListener); - elemThree.addEventListener("select", eventListener); - shadowOne.addEventListener("select", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("select", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that select event is stopped at shadow root."); - - // Test stopping "change" event. - - elemOne.addEventListener("change", eventListener); - elemTwo.addEventListener("change", eventListener); - elemThree.addEventListener("change", eventListener); - shadowOne.addEventListener("change", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("change", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - - // Test stopping "reset" event. - - elemOne.addEventListener("reset", eventListener); - elemTwo.addEventListener("reset", eventListener); - elemThree.addEventListener("reset", eventListener); - shadowOne.addEventListener("reset", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("reset", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that reset event is stopped at shadow root."); - - // Test stopping "load" event. - - elemOne.addEventListener("load", eventListener); - elemTwo.addEventListener("load", eventListener); - elemThree.addEventListener("load", eventListener); - shadowOne.addEventListener("load", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("load", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that load event is stopped at shadow root."); - - // Test stopping "resize" event. - - elemOne.addEventListener("resize", eventListener); - elemTwo.addEventListener("resize", eventListener); - elemThree.addEventListener("resize", eventListener); - shadowOne.addEventListener("resize", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("resize", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that resize event is stopped at shadow root."); - - // Test stopping "scroll" event. - - elemOne.addEventListener("scroll", eventListener); - elemTwo.addEventListener("scroll", eventListener); - elemThree.addEventListener("scroll", eventListener); - shadowOne.addEventListener("scroll", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("scroll", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that scroll event is stopped at shadow root."); - - // Test stopping "selectstart" event. - - elemOne.addEventListener("selectstart", eventListener); - elemTwo.addEventListener("selectstart", eventListener); - elemThree.addEventListener("selectstart", eventListener); - shadowOne.addEventListener("selectstart", eventListener); - - eventChain = []; - - customEvent = new CustomEvent("selectstart", { "bubbles" : true }); - elemThree.dispatchEvent(customEvent); - isEventChain(eventChain, [elemThree, elemTwo, shadowOne], "Test that selectstart event is stopped at shadow root."); - - SimpleTest.finish(); - }); -</script> -</body> -</html> |