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

Unified Diff: Source/core/rendering/RenderGrid.cpp

Issue 22983004: [CSS Grid Layout] Speed up content sized track layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | « PerformanceTests/Layout/auto-grid-lots-of-data.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index 9d0d58990de04c5fe7aeb8b1dee48edbb24739b6..36530fb98d2bdc580428766e73168c2e9758cb69 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -509,18 +509,14 @@ size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const
LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<GridTrack>& columnTracks)
{
- // FIXME: We shouldn't force a layout every time this function is called but
- // 1) Return computeLogicalHeight's value if it's available. Unfortunately computeLogicalHeight
- // doesn't return if the logical height is available so would need to be changed.
- // 2) Relayout if the column track's used breadth changed OR the logical height is unavailable.
- if (!child->needsLayout())
+ if (child->style()->logicalHeight().isPercent())
ojan 2013/08/13 17:22:21 What if it's position:absolute; top:0; bottom: 0?
Julien - ping for review 2013/08/13 18:45:43 Absolutely positioned grid items don't participate
child->setNeedsLayout(MarkOnlyThis);
child->setOverrideContainingBlockContentLogicalWidth(gridAreaBreadthForChild(child, ForColumns, columnTracks));
// If |child| has a percentage 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);
- child->layout();
+ child->layoutIfNeeded();
return child->logicalHeight();
}
« no previous file with comments | « PerformanceTests/Layout/auto-grid-lots-of-data.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698