Bug 984548 - Ifdef APZ overflow:hidden behaviour so it doesn't regress Fennec pending a proper fix. r=tn

This commit is contained in:
Kartikaya Gupta 2014-03-25 09:25:56 -04:00
parent 2f3c5ba795
commit 86f2de786f

View File

@ -673,6 +673,13 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
if (scrollableFrame) {
nsRect contentBounds = scrollableFrame->GetScrollRange();
nsPoint scrollPosition = scrollableFrame->GetScrollPosition();
// We ifndef the below code for Fennec because it requires special behaviour
// on the APZC side. Because Fennec has it's own PZC implementation which doesn't
// provide the special behaviour, this code will cause it to break. We can remove
// the ifndef once Fennec switches over to APZ or if we add the special handling
// to Fennec
#ifndef MOZ_WIDGET_ANDROID
if (scrollableFrame->GetScrollbarStyles().mVertical == NS_STYLE_OVERFLOW_HIDDEN) {
contentBounds.y = scrollPosition.y;
contentBounds.height = 0;
@ -681,6 +688,8 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
contentBounds.x = scrollPosition.x;
contentBounds.width = 0;
}
#endif
contentBounds.width += scrollableFrame->GetScrollPortRect().width;
contentBounds.height += scrollableFrame->GetScrollPortRect().height;
metrics.mScrollableRect = CSSRect::FromAppUnits(contentBounds);