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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2345103002: Freeze scrollbars for relayout if overflow:auto added scrollbars. (Closed)
Patch Set: Created 4 years, 3 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: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 414cd3fac966de2f5e1af5151cb1beb3984d52e6..05e42b617282680ae247cf98806e8a2b5bcc433a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -484,8 +484,13 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge);
bool preferredLogicalWidthsBecameDirty = !preferredLogicalWidthsWereDirty && preferredLogicalWidthsDirty();
- if (preferredLogicalWidthsBecameDirty)
- return false;
+ if (preferredLogicalWidthsBecameDirty) {
+ // The only thing that should dirty preferred widths at this point is the addition of
+ // overflow:auto scrollbars in a descendant. To avoid a potential infinite loop,
+ // run layout again with auto scrollbars frozen in their current state.
+ PaintLayerScrollableArea::FreezeScrollbarsScope freezeScrollbars;
+ return layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope);
+ }
// Expand our intrinsic height to encompass floats.
if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNewFormattingContext())

Powered by Google App Engine
This is Rietveld 408576698