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

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

Issue 946553003: [CSS Grid Layout] Avoid reset override logical width/height for non relative elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased patch after LayoutGrid rename Created 5 years, 10 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/LayoutGrid.cpp
diff --git a/Source/core/layout/LayoutGrid.cpp b/Source/core/layout/LayoutGrid.cpp
index add685ab608673b919360b1109411e75028b78bd..133368064420ad67b5d8e71e05704321da5cc8b5 100644
--- a/Source/core/layout/LayoutGrid.cpp
+++ b/Source/core/layout/LayoutGrid.cpp
@@ -617,15 +617,16 @@ LayoutUnit LayoutGrid::logicalHeightForChild(LayoutBox& child, Vector<GridTrack>
SubtreeLayoutScope layoutScope(child);
LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child.hasOverrideContainingBlockLogicalWidth() ? child.overrideContainingBlockContentLogicalWidth() : LayoutUnit();
LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks);
- if (child.style()->logicalHeight().isPercent() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth)
+ if (child.hasRelativeLogicalHeight() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth)
layoutScope.setNeedsLayout(&child);
child.clearOverrideLogicalContentHeight();
child.setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth);
- // If |child| has a percentage logical height, we shouldn't let it override its intrinsic height, which is
+ // If |child| has a relative logical height, we shouldn't let it override its intrinsic height, which is
// what we are interested in here. Thus we need to set the override logical height to -1 (no possible resolution).
- child.setOverrideContainingBlockContentLogicalHeight(-1);
+ if (child.hasRelativeLogicalHeight())
+ child.setOverrideContainingBlockContentLogicalHeight(-1);
Manuel Rego 2015/03/05 06:31:07 Applied the same change to the new lines doing:
child.layoutIfNeeded();
return child.logicalHeight() + child.marginLogicalHeight();
}

Powered by Google App Engine
This is Rietveld 408576698