summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/cssom/cssimportrule-sheet-identity.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/cssom/cssimportrule-sheet-identity.html')
-rw-r--r--testing/web-platform/tests/css/cssom/cssimportrule-sheet-identity.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom/cssimportrule-sheet-identity.html b/testing/web-platform/tests/css/cssom/cssimportrule-sheet-identity.html
new file mode 100644
index 0000000000..3db5634ebe
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/cssimportrule-sheet-identity.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>CSSImportRule has different sheets even if referencing the same URL</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://drafts.csswg.org/cssom/#the-cssimportrule-interface">
+<link rel="stylesheet" href="support/import-rule.css">
+<link rel="stylesheet" href="support/import-rule.css">
+<script>
+let t = async_test("CSSImportRule has different sheets even if referencing the same URL");
+window.onload = t.step_func_done(function() {
+ let sheet1 = document.styleSheets[0];
+ let sheet2 = document.styleSheets[1];
+
+ assert_not_equals(sheet1, sheet2);
+
+ let childSheet1 = sheet1.cssRules[0].styleSheet;
+ let childSheet2 = sheet2.cssRules[0].styleSheet;
+
+ assert_not_equals(childSheet1, null);
+ assert_not_equals(childSheet2, null);
+ assert_not_equals(childSheet1, childSheet2, "@import pointing to the same URL shouldn't point to the same StyleSheet object");
+});
+</script>