зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1209603 patch 4 - Add reftest for bug 1209603. r=heycam
--HG-- extra : commitid : 9PKKSv4RbaG
This commit is contained in:
Родитель
a80ca8c869
Коммит
d8ffda64d3
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>Testcase, bug 1209603</title>
|
||||
<style>
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<p style="font-size: 40px">Should be 40px font size.</p>
|
||||
|
||||
<p style="font-size: 20px">Should be 20px font size.</p>
|
|
@ -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 style context construction and computation of the font struct on
|
||||
// B's parent
|
||||
getComputedStyle(b.parentNode, "").fontSize;
|
||||
|
||||
// force style context 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>
|
|
@ -1936,3 +1936,4 @@ fuzzy(1,74) fuzzy-if(gtkWidget,6,79) == 1174332-1.html 1174332-1-ref.html
|
|||
== 1202512-1.html 1202512-1-ref.html
|
||||
== 1202512-2.html 1202512-2-ref.html
|
||||
!= 1207326-1.html about:blank
|
||||
fails == 1209603-1.html 1209603-1-ref.html # bug 1209603
|
||||
|
|
Загрузка…
Ссылка в новой задаче