diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate.html')
-rw-r--r-- | tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate.html b/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate.html new file mode 100644 index 00000000000..30a3ed1d09b --- /dev/null +++ b/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate.html @@ -0,0 +1,20 @@ +<!doctype html> +<title>Cascade order of a stylesheet for duplicate sheets.</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="help" href="https://wicg.github.io/construct-stylesheets/"> +<script src = '/resources/testharness.js'></script> +<script src = '/resources/testharnessreport.js'></script> +<div></div> +<script> +test(function() { + let sheets = []; + + for (let i = 0; i < 2; ++i) { + sheets.push(new CSSStyleSheet()); + sheets[i].replaceSync("div { z-index: " + i + " }"); + } + + document.adoptedStyleSheets = [sheets[1], sheets[0], sheets[1]]; + assert_equals(getComputedStyle(document.querySelector("div")).zIndex, "1", "duplicate stylesheet should take right position in the cascade"); +}); +</script> |