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

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

Issue 23694023: Remove an extra relayout for non-percent logical height grid items (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index cd2d268e4cc698a6118351e88b355458386dfef6..7197601557c14c85ebd8b51b9611fd2fb12acb3e 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -845,6 +845,14 @@ void RenderGrid::dirtyGrid()
m_gridIsDirty = true;
}
+static bool gridItemDependsOnGridAreaLogicalHeight(const RenderBox* gridItem)
+{
+ const Length& logicalHeight = gridItem->style()->logicalHeight();
+ // FIXME: This is wrong if the grid area and the grid item have orthogonal writing modes,
+ // but the rest of the code doesn't handle this case anyway (http://crbug.com/234194).
+ return logicalHeight.isPercent();
ojan 2013/09/07 17:13:20 Don't you also need to check maxHeight/minHeight?
Julien - ping for review 2013/09/09 18:04:42 I think you are right, I will add more testing for
+}
+
void RenderGrid::layoutGridItems()
{
placeItemsOnGrid();
@@ -870,7 +878,7 @@ void RenderGrid::layoutGridItems()
LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChild(child, ForRows, rowTracks);
SubtreeLayoutScope layoutScope(child);
- if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight)
+ if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || (gridItemDependsOnGridAreaLogicalHeight(child) && oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight))
layoutScope.setNeedsLayout(child);
child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth);
« 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