diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-cascade/idlharness.html')
-rw-r--r-- | testing/web-platform/tests/css/css-cascade/idlharness.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-cascade/idlharness.html b/testing/web-platform/tests/css/css-cascade/idlharness.html new file mode 100644 index 0000000000..9bde23b946 --- /dev/null +++ b/testing/web-platform/tests/css/css-cascade/idlharness.html @@ -0,0 +1,36 @@ +<!doctype html> +<title>CSS Cascade Layers IDL tests</title> +<link rel="help" href="https://drafts.csswg.org/css-cascade-5/#layer-apis"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/WebIDLParser.js"></script> +<script src="/resources/idlharness.js"></script> + +<style> +@layer bar, baz; +@import url('data:text/css,') layer(qux); +@layer foo { } +</style> + +<script> + 'use strict'; + idl_test( + ['css-cascade'], + ['cssom'], + idl_array => { + try { + self.statement = document.styleSheets[0].cssRules.item(0); + self.layeredImport = document.styleSheets[0].cssRules.item(1); + self.block = document.styleSheets[0].cssRules.item(2); + } catch (e) { + // Will be surfaced when any rule is undefined below. + } + + idl_array.add_objects({ + CSSLayerBlockRule: ['block'], + CSSLayerStatementRule: ['statement'], + CSSImportRule: ['layeredImport'] + }); + } + ); +</script> |