Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1114)

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 1213353003: More fixes for position:fixed with root layer scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}
}

Powered by Google App Engine
This is Rietveld 408576698