diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/base/tests/test_bug416896.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | layout/base/tests/test_bug416896.html | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/layout/base/tests/test_bug416896.html b/layout/base/tests/test_bug416896.html new file mode 100644 index 0000000000..894b3939c0 --- /dev/null +++ b/layout/base/tests/test_bug416896.html @@ -0,0 +1,64 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=416896 +--> +<head> + <title>Test for Bug 416896</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> + <link rel="stylesheet" type="text/css" id="l" + href="data:text/css,a { color: green }"/> + <style type="text/css" id="i"> a { color: blue; } </style> + +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=416896">Mozilla Bug 416896</a> +<p id="display"></p> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +/** Test for Bug 416896 **/ + + const InspectorUtils = SpecialPowers.InspectorUtils; + + var inlineSheet = $("i").sheet; + isnot(inlineSheet, null, "Should have sheet here"); + + var linkedSheet = $("l").sheet; + isnot(linkedSheet, null, "Should have sheet here"); + + var inspectedRules = InspectorUtils.getCSSStyleRules(document.links[0]); + + var seenInline = false; + var seenLinked = false; + + for (var i = 0; i < inspectedRules.length; ++i) + { + var rule = inspectedRules[i]; + var sheet = rule.parentStyleSheet; + if (SpecialPowers.unwrap(sheet) == inlineSheet) { + is(sheet.href, null, "It's an inline sheet"); + is(seenInline, false, "Only one inline rule matches"); + seenInline = true; + } else { + isnot(sheet.href, null, "Shouldn't have null href here " + i); + if (SpecialPowers.unwrap(sheet) == linkedSheet) { + is(seenLinked, false, "Only one linked rule matches"); + seenLinked = true; + } + } + } + + is(seenLinked, true, "Didn't find the linked rule?"); + is(seenInline, true, "Didn't find the inline rule?"); + + +</script> +</pre> +</body> +</html> + |