Bug 534808. Need to clear descendant intrinsic widths on height changes, due to replaced elements. r=dbaron

This commit is contained in:
Boris Zbarsky 2009-12-29 15:13:54 -05:00
Родитель 7c27f673da
Коммит 99bd5c1a6a
6 изменённых файлов: 93 добавлений и 8 удалений

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { border-spacing: 0; }
td { padding: 0; border: 1px solid; line-height: 1px; }
img { visibility: hidden; vertical-align: bottom; }
</style>
</head>
<body>
<table><tr><td>
<img src="solidblue.png">
</td></tr></table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { border-spacing: 0; }
td { padding: 0; border: 1px solid; line-height: 1px; }
img { visibility: hidden; vertical-align: bottom; }
</style>
</head>
<body onload="document.getElementById('forty').style.height = '';">
<table><tr><td><div style="height: 40px" id="forty"><div style="height: 100%">
<img src="solidblue.png" style="height: 75%">
</div></div></td></tr></table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { border-spacing: 0; }
td { padding: 0; border: 1px solid; line-height: 1px; }
img { visibility: hidden; vertical-align: bottom; }
</style>
</head>
<body>
<!-- solidblue.png is a 16x16 image -->
<table><tr><td><div style="height: 40px">
<img src="solidblue.png" style="width: 32px">
</div></td></tr></table>
</body>
</html>

Просмотреть файл

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { border-spacing: 0; }
td { padding: 0; border: 1px solid; line-height: 1px; }
img { visibility: hidden; vertical-align: bottom; }
</style>
</head>
<body>
<!-- solidblue.png is a 16x16 image -->
<table><tr><td><div style="height: 40px" id="forty"><div style="height: 100%">
<img src="solidblue.png" style="height: 80%">
</div></div></td></tr></table>
</body>
</html>

Просмотреть файл

@ -1359,4 +1359,6 @@ fails HTTP(..) == 518172-2b.html 518172-b-ref.html # bug 518172
== 530686-1.html 530686-1-ref.html
== 531098-1.html 531098-1-ref.html
== 531371-1.html 531371-1-ref.html
== 534808-1.html 534808-1-ref.html
== 534808-2.html 534808-2-ref.html
== 534919-1.html 534919-1-ref.html

Просмотреть файл

@ -1106,14 +1106,13 @@ nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) cons
if (mHeight != aOther.mHeight ||
mMinHeight != aOther.mMinHeight ||
mMaxHeight != aOther.mMaxHeight) {
// Height changes can't affect descendant intrinsic sizes, but due to our
// not-so-great computation of mVResize in nsHTMLReflowState, do need to
// force reflow of the whole subtree.
// XXXbz due to XUL caching heights as well, height changes _do_
// need to clear ancestor intrinsics!
return NS_CombineHint(hint,
NS_SubtractHint(nsChangeHint_ReflowFrame,
nsChangeHint_ClearDescendantIntrinsics));
// Height changes can affect descendant intrinsic sizes due to replaced
// elements with percentage heights in descendants which also have
// percentage heights. And due to our not-so-great computation of mVResize
// in nsHTMLReflowState, they do need to force reflow of the whole subtree.
// XXXbz due to XUL caching heights as well, height changes also need to
// clear ancestor intrinsics!
return NS_CombineHint(hint, nsChangeHint_ReflowFrame);
}
if ((mWidth == aOther.mWidth) &&