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

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

Issue 2341433003: [css-grid] Fix excesive usage of SubtreeLayoutScope (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 | « no previous file | 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 a34960d16c5496f9514bb0a222be58472a526579..083ad57217c1b2ca007c3a4a8a7a650bd5ccec30 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -953,12 +953,11 @@ bool LayoutGrid::isOrthogonalChild(const LayoutBox& child) const
LayoutUnit LayoutGrid::logicalHeightForChild(LayoutBox& child, GridSizingData& sizingData) const
{
GridTrackSizingDirection childBlockDirection = flowAwareDirectionForChild(child, ForRows);
- SubtreeLayoutScope layoutScope(child);
// 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 block-axis override size to -1 (no possible resolution).
if (shouldClearOverrideContainingBlockContentSizeForChild(child, ForRows)) {
setOverrideContainingBlockContentSizeForChild(child, childBlockDirection, LayoutUnit(-1));
- layoutScope.setNeedsLayout(&child, LayoutInvalidationReason::GridChanged);
+ child.setNeedsLayout(LayoutInvalidationReason::GridChanged);
}
// We need to clear the stretched height to properly compute logical height during layout.
@@ -1029,7 +1028,6 @@ LayoutUnit LayoutGrid::minContentForChild(LayoutBox& child, GridTrackSizingDirec
return child.logicalHeight() + child.marginLogicalHeight();
}
- SubtreeLayoutScope layouter(child);
if (updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection, sizingData))
child.setNeedsLayout(LayoutInvalidationReason::GridChanged);
return logicalHeightForChild(child, sizingData);
@@ -1059,7 +1057,6 @@ LayoutUnit LayoutGrid::maxContentForChild(LayoutBox& child, GridTrackSizingDirec
return child.logicalHeight() + child.marginLogicalHeight();
}
- SubtreeLayoutScope layouter(child);
if (updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection, sizingData))
child.setNeedsLayout(LayoutInvalidationReason::GridChanged);
return logicalHeightForChild(child, sizingData);
@@ -1913,9 +1910,8 @@ void LayoutGrid::layoutGridItems(GridSizingData& sizingData)
LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChildIncludingAlignmentOffsets(*child, ForColumns, sizingData);
LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChildIncludingAlignmentOffsets(*child, ForRows, sizingData);
- SubtreeLayoutScope layoutScope(*child);
if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || (oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight && child->hasRelativeLogicalHeight()))
- layoutScope.setNeedsLayout(child, LayoutInvalidationReason::GridChanged);
+ child->setNeedsLayout(LayoutInvalidationReason::GridChanged);
child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth);
child->setOverrideContainingBlockContentLogicalHeight(overrideContainingBlockContentLogicalHeight);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698