mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 522390. Fix percentage-height kids of scrollframes in quirks mode to deal with the height of the scrollframe becoming auto. r=dbaron
This commit is contained in:
parent
d69d1afc18
commit
c2173a710f
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body>
|
||||
<div id="a" style="overflow:auto; width:200px">
|
||||
<div style="background: green; height:100%">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body onload="document.getElementById('a').style.removeProperty('height');">
|
||||
<div id="a" style="overflow:auto; height:200px; width:200px">
|
||||
<div style="background: green; height:100%">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
@ -21,3 +21,4 @@
|
||||
== hScrollSimpleMinHeightQuirks-3D.html greenboxhbar.html
|
||||
== hScrollAbsMinHeightD.html greenboxhbar.html
|
||||
== hScrollAbsMinHeightQuirksD.html greenboxhbar.html
|
||||
== dynamicHeight100.html dynamicHeight100-ref.html
|
||||
|
@ -1102,29 +1102,42 @@ nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) cons
|
||||
// FIXME: Bug 507764. Why do we need reflow here?
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
}
|
||||
|
||||
|
||||
if (mBoxSizing != aOther.mBoxSizing) {
|
||||
return nsChangeHint_ReflowFrame;
|
||||
}
|
||||
|
||||
nsChangeHint heightHint = NS_STYLE_HINT_NONE;
|
||||
if (mHeight != aOther.mHeight ||
|
||||
mMinHeight != aOther.mMinHeight ||
|
||||
mMaxHeight != aOther.mMaxHeight) {
|
||||
// Height changes can't affect intrinsic widths, but due to our
|
||||
// not-so-great computation of mVResize in nsHTMLReflowState, do need to
|
||||
// force reflow of the whole subtree.
|
||||
heightHint =
|
||||
NS_CombineHint(nsChangeHint_NeedReflow, nsChangeHint_NeedDirtyReflow);
|
||||
}
|
||||
|
||||
if ((mWidth == aOther.mWidth) &&
|
||||
(mMinWidth == aOther.mMinWidth) &&
|
||||
(mMaxWidth == aOther.mMaxWidth) &&
|
||||
(mHeight == aOther.mHeight) &&
|
||||
(mMinHeight == aOther.mMinHeight) &&
|
||||
(mMaxHeight == aOther.mMaxHeight) &&
|
||||
(mBoxSizing == aOther.mBoxSizing)) {
|
||||
(mMaxWidth == aOther.mMaxWidth)) {
|
||||
if (mOffset == aOther.mOffset) {
|
||||
return NS_STYLE_HINT_NONE;
|
||||
return heightHint;
|
||||
} else {
|
||||
// Offset changes only affect positioned content, and can't affect any
|
||||
// intrinsic widths. They also don't need to force reflow of
|
||||
// descendants.
|
||||
return nsChangeHint_NeedReflow;
|
||||
return NS_CombineHint(heightHint, nsChangeHint_NeedReflow);
|
||||
}
|
||||
}
|
||||
|
||||
// None of our differences can affect descendant intrinsic sizes and none of
|
||||
// them need to force children to reflow.
|
||||
return NS_SubtractHint(nsChangeHint_ReflowFrame,
|
||||
NS_CombineHint(nsChangeHint_ClearDescendantIntrinsics,
|
||||
nsChangeHint_NeedDirtyReflow));
|
||||
// None of our width differences can affect descendant intrinsic
|
||||
// sizes and none of them need to force children to reflow.
|
||||
return
|
||||
NS_CombineHint(heightHint,
|
||||
NS_SubtractHint(nsChangeHint_ReflowFrame,
|
||||
NS_CombineHint(nsChangeHint_ClearDescendantIntrinsics,
|
||||
nsChangeHint_NeedDirtyReflow)));
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user