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

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: Patch for landing 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
« no previous file with comments | « Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutGrid.cpp
diff --git a/Source/core/layout/LayoutGrid.cpp b/Source/core/layout/LayoutGrid.cpp
index 7a34eb23ed5b209441121b75d93a4994587bae9f..d835381821b494254ab2f3e1f64b269df7458371 100644
--- a/Source/core/layout/LayoutGrid.cpp
+++ b/Source/core/layout/LayoutGrid.cpp
@@ -617,16 +617,17 @@ 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);
// We need to clear the stretched height to properly compute logical height during layout.
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);
child.layoutIfNeeded();
// If the child was stretched we should use its intrinsic height.
return (child.hasOverrideHeight() ? childIntrinsicHeight(child) : child.logicalHeight()) + child.marginLogicalHeight();
@@ -640,9 +641,9 @@ LayoutUnit LayoutGrid::minContentForChild(LayoutBox& child, GridTrackSizingDirec
return 0;
if (direction == ForColumns) {
- // If |child| has a percentage logical width, we shouldn't let it override its intrinsic width, which is
+ // If |child| has a relative logical width, we shouldn't let it override its intrinsic width, which is
// what we are interested in here. Thus we need to set the override logical width to -1 (no possible resolution).
- if (child.style()->logicalWidth().isPercent())
+ if (child.hasRelativeLogicalWidth())
child.setOverrideContainingBlockContentLogicalWidth(-1);
// FIXME: It's unclear if we should return the intrinsic width or the preferred width.
@@ -661,9 +662,9 @@ LayoutUnit LayoutGrid::maxContentForChild(LayoutBox& child, GridTrackSizingDirec
return LayoutUnit();
if (direction == ForColumns) {
- // If |child| has a percentage logical width, we shouldn't let it override its intrinsic width, which is
+ // If |child| has a relative logical width, we shouldn't let it override its intrinsic width, which is
// what we are interested in here. Thus we need to set the override logical width to -1 (no possible resolution).
- if (child.style()->logicalWidth().isPercent())
+ if (child.hasRelativeLogicalWidth())
child.setOverrideContainingBlockContentLogicalWidth(-1);
// FIXME: It's unclear if we should return the intrinsic width or the preferred width.
« no previous file with comments | « Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698