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/reftests/bugs/1209603-1.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/bugs/1209603-1.html')
-rw-r--r-- | layout/reftests/bugs/1209603-1.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/layout/reftests/bugs/1209603-1.html b/layout/reftests/bugs/1209603-1.html new file mode 100644 index 0000000000..2d606f1377 --- /dev/null +++ b/layout/reftests/bugs/1209603-1.html @@ -0,0 +1,50 @@ +<!DOCTYPE HTML> +<title>Testcase, bug 1209603</title> +<style> + +p { + font-size: 2em; + + /* ensure font-size dependency in the margin struct; this is also in + the UA style sheet, but repeated here for clarity */ + margin: 1em 0; +} + +</style> + +<div style="font-size: 20px"><p id="a">Should be 40px font size.</p></div> + +<script> + +var a = document.getElementById("a"); + +// force computation of the margin struct on A (caching in rule tree) +getComputedStyle(a, "").marginTop; + +</script> + +<!-- will dynamically change font-size to 10px later; + also needs to be different from 20px now to avoid sibling-sharing --> +<div style="font-size: 30px"><p id="b">Should be 20px font size.</p></div> + +<script> +// Note that A and B share rule nodes, and note that the margin struct +// has been conditionally (on font size) cached on their shared rule node. +var b = document.getElementById("b"); + +// force ComputedStyle construction and computation of the font struct on +// B's parent +getComputedStyle(b.parentNode, "").fontSize; + +// force ComputedStyle construction (and computation of the color +// struct) on B, but not the margin struct or font struct +getComputedStyle(b, "").color; + +// restyle B and flush +b.parentNode.style.fontSize = "10px"; +getComputedStyle(b, "").marginTop; +// This flush will call CalcStyleDifference on B, which will find no +// cached font struct on the old context, but which will find a +// cached margin struct on the rule node. + +</script> |