Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: dom/tests/mochitest/chrome/chrome.toml
<!DOCTYPE HTML>
<div id="dut" class="foo"></div>
<script>
SimpleTest.waitForExplicitFinish();
addEventListener("DOMContentLoaded", () => {
const sss = Cc["@mozilla.org/content/style-sheet-service;1"]
.getService(Ci.nsIStyleSheetService);
const utils = window.windowUtils;
const userUrl = encodeURI("data:text/css,body { @scope { .foo { color: green; } } }");
utils.loadSheetUsingURIString(userUrl, sss.USER_SHEET);
const s = getComputedStyle(dut);
is(s.color, "rgb(0, 128, 0)", ".foo has implicitly scoped style applied.");
SimpleTest.finish();
});
</script>