Bug 942995 - Squish the FrameMetrics::mScrollableRect for overflow:hidden elements. r=tn

This commit is contained in:
Botond Ballo 2013-11-26 18:46:47 -05:00
parent 2be311daa9
commit 811c422a69

View File

@ -619,6 +619,12 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
if (scrollableFrame) {
nsRect contentBounds = scrollableFrame->GetScrollRange();
if (scrollableFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_HIDDEN) {
contentBounds.height = 0;
}
if (scrollableFrame->GetScrollbarStyles().mHorizontal == NS_STYLE_OVERFLOW_HIDDEN) {
contentBounds.width = 0;
}
contentBounds.width += scrollableFrame->GetScrollPortRect().width;
contentBounds.height += scrollableFrame->GetScrollPortRect().height;
metrics.mScrollableRect = CSSRect::FromAppUnits(contentBounds);