Index: Source/core/layout/LayoutBox.cpp |
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp |
index 20aca77f26ceaab7599f6bade59be3bdd749f70e..60c7f8a8e333db021d469cf5ed08e0634bab99fe 100644 |
--- a/Source/core/layout/LayoutBox.cpp |
+++ b/Source/core/layout/LayoutBox.cpp |
@@ -2709,8 +2709,9 @@ LayoutUnit LayoutBox::containingBlockLogicalWidthForPositioned(const LayoutBoxMo |
if (style()->position() == FixedPosition && containingBlock->isLayoutView()) { |
const LayoutView* view = toLayoutView(containingBlock); |
if (FrameView* frameView = view->frameView()) { |
- LayoutRect viewportRect = LayoutRect(frameView->visibleContentRect()); |
- return containingBlock->isHorizontalWritingMode() ? viewportRect.width() : viewportRect.height(); |
+ // Don't use visibleContentRect since the DeprecatedPaintLayer's size has not been set yet. |
+ IntSize viewportSize = frameView->layoutViewportScrollableArea()->excludeScrollbars(frameView->frameRect().size()); |
+ return containingBlock->isHorizontalWritingMode() ? viewportSize.width() : viewportSize.height(); |
} |
} |
@@ -2752,8 +2753,9 @@ LayoutUnit LayoutBox::containingBlockLogicalHeightForPositioned(const LayoutBoxM |
if (style()->position() == FixedPosition && containingBlock->isLayoutView()) { |
const LayoutView* view = toLayoutView(containingBlock); |
if (FrameView* frameView = view->frameView()) { |
- LayoutRect viewportRect = LayoutRect(frameView->visibleContentRect()); |
- return containingBlock->isHorizontalWritingMode() ? viewportRect.height() : viewportRect.width(); |
+ // Don't use visibleContentRect since the DeprecatedPaintLayer's size has not been set yet. |
+ IntSize viewportSize = frameView->layoutViewportScrollableArea()->excludeScrollbars(frameView->frameRect().size()); |
+ return containingBlock->isHorizontalWritingMode() ? viewportSize.height() : viewportSize.width(); |
} |
} |