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

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

Issue 2361373002: [css-grid] Clearing override sizes before running grid's layout logic. (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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index ec13d1934a0da3df498bbfaa44792491e7bfb277..b911a70241464478927a9a29bd7abb6dddd2e78e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -452,6 +452,19 @@ void LayoutGrid::layoutBlock(bool relayoutChildren)
LayoutSize previousSize = size();
+ // We need to clear both own and containingBlock override sizes to ensure we get the same
+ // result through consecutive layout calls.
+ if (!m_gridIsDirty) {
cbiesinger 2016/09/26 14:56:38 && (sizesLogicalWidthToFitContent(style()->width()
+ for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
+ if (child->isOutOfFlowPositioned())
cbiesinger 2016/09/26 14:56:38 || !hasOrthogonalFlow(child)
+ continue;
+ child->clearOverrideSize();
+ child->clearContainingBlockOverrideSize();
+ layoutScope.setChildNeedsLayout(child);
cbiesinger 2016/09/23 16:57:09 (I would use forceChildLayout() instead of this se
jfernandez 2016/09/23 18:47:22 I understand your point and I agree the current co
+ child->layoutIfNeeded();
svillar 2016/09/23 15:42:28 Why are you laying out the items even before placi
jfernandez 2016/09/23 18:47:22 Well, that code address issues related to subseque
+ }
+ }
+
updateLogicalWidth();
m_hasDefiniteLogicalHeight = hasDefiniteLogicalHeight();
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698