From 99bd5c1a6adc35f8f49a543e75bf9ca081cdd0fc Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 29 Dec 2009 15:13:54 -0500 Subject: [PATCH] Bug 534808. Need to clear descendant intrinsic widths on height changes, due to replaced elements. r=dbaron --- layout/reftests/bugs/534808-1-ref.html | 20 ++++++++++++++++++++ layout/reftests/bugs/534808-1.html | 20 ++++++++++++++++++++ layout/reftests/bugs/534808-2-ref.html | 22 ++++++++++++++++++++++ layout/reftests/bugs/534808-2.html | 22 ++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 2 ++ layout/style/nsStyleStruct.cpp | 15 +++++++-------- 6 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 layout/reftests/bugs/534808-1-ref.html create mode 100644 layout/reftests/bugs/534808-1.html create mode 100644 layout/reftests/bugs/534808-2-ref.html create mode 100644 layout/reftests/bugs/534808-2.html diff --git a/layout/reftests/bugs/534808-1-ref.html b/layout/reftests/bugs/534808-1-ref.html new file mode 100644 index 00000000000..ddb8a855f85 --- /dev/null +++ b/layout/reftests/bugs/534808-1-ref.html @@ -0,0 +1,20 @@ + + + + + + + + +
+ +
+ + + diff --git a/layout/reftests/bugs/534808-1.html b/layout/reftests/bugs/534808-1.html new file mode 100644 index 00000000000..c112098dc18 --- /dev/null +++ b/layout/reftests/bugs/534808-1.html @@ -0,0 +1,20 @@ + + + + + + + + +
+ +
+ + + diff --git a/layout/reftests/bugs/534808-2-ref.html b/layout/reftests/bugs/534808-2-ref.html new file mode 100644 index 00000000000..decfe467183 --- /dev/null +++ b/layout/reftests/bugs/534808-2-ref.html @@ -0,0 +1,22 @@ + + + + + + + + + + +
+ +
+ + + diff --git a/layout/reftests/bugs/534808-2.html b/layout/reftests/bugs/534808-2.html new file mode 100644 index 00000000000..c4a6bd458bd --- /dev/null +++ b/layout/reftests/bugs/534808-2.html @@ -0,0 +1,22 @@ + + + + + + + + + + +
+ +
+ + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 40f1d45cff2..16acbc0f870 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -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 diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index c6ba837a03c..5a82146549f 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -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) &&