diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 7b7c53153df5..796b6fdcd023 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -8045,6 +8045,9 @@ nsRect nsLayoutUtils::CalculateScrollableRectForFrame( contentBounds.height += aScrollableFrame->GetScrollPortRect().height; } else { contentBounds = aRootFrame->GetRect(); + // Clamp to (0, 0) if there is no corresponding scrollable frame for the + // given |aRootFrame|. + contentBounds.MoveTo(0, 0); } return contentBounds; }