1
0
Fork 0
firefox/testing/web-platform/tests/css/cssom/cssimportrule-parent.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
979 B
HTML

<!doctype html>
<title>CSSImportRule correctly unlinks its child stylesheet from its parent</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">
<style>
@import "data:text/css,:root{background:red}";
</style>
<script>
let t = async_test("@import stylesheet is properly unlinked from parent after removal");
window.onload = t.step_func_done(function() {
let sheet = document.styleSheets[0];
let childSheet = sheet.cssRules[0].styleSheet;
assert_not_equals(childSheet, null, "@import rule should have a stylesheet");
assert_equals(childSheet.parentStyleSheet, sheet, "@import rule should the correct parent");
sheet.deleteRule(0);
assert_equals(childSheet.parentStyleSheet, null, "@import rule should be correctly unlinked");
});
</script>