diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/tests/mochitest/webcomponents/test_shadowroot_inert_element.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/tests/mochitest/webcomponents/test_shadowroot_inert_element.html')
-rw-r--r-- | dom/tests/mochitest/webcomponents/test_shadowroot_inert_element.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/dom/tests/mochitest/webcomponents/test_shadowroot_inert_element.html b/dom/tests/mochitest/webcomponents/test_shadowroot_inert_element.html new file mode 100644 index 000000000..ca525adad --- /dev/null +++ b/dom/tests/mochitest/webcomponents/test_shadowroot_inert_element.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=806506 +--> +<head> + <title>Test for inert elements in ShadowRoot</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body onload="runChecks();"> +<div id="grabme"></div> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=806506">Bug 806506</a> +<script> + +var element = document.getElementById("grabme"); +var shadow = element.createShadowRoot(); + +// Check that <base> is inert. +shadow.innerHTML = '<base href="http://www.example.org/" />'; +isnot(document.baseURI, "http://www.example.org/", "Base element should be inert in ShadowRoot."); + +SimpleTest.waitForExplicitFinish(); + +// Check that <link> is inert. +var numStyleBeforeLoad = document.styleSheets.length; + +shadow.innerHTML = '<link id="shadowlink" rel="stylesheet" type="text/css" href="inert_style.css" /><span id="shadowspan"></span>'; +shadow.applyAuthorStyles = true; +var shadowSpan = shadow.getElementById("shadowspan"); +var shadowStyle = shadow.getElementById("shadowlink"); + +function runChecks() { + isnot(getComputedStyle(shadowSpan, null).getPropertyValue("padding-top"), "10px", "Link element should be inert."); + is(document.styleSheets.length, numStyleBeforeLoad, "Document style count should remain the same because the style should not be in the doucment."); + is(shadow.styleSheets.length, 0, "Inert link should not add style to ShadowRoot."); + // Remove link to make sure we don't get assertions. + shadow.removeChild(shadowStyle); + SimpleTest.finish(); +}; + +</script> +</body> +</html> |