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

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

Issue 2411333007: [css-grid] Avoid storing pointers to orthogonal grid items (Closed)
Patch Set: Patch for landing. Created 4 years, 2 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 | « third_party/WebKit/Source/core/layout/LayoutGrid.h ('k') | 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 2b40465d3599ba4efff6b6b75a6f8cf3c81b7755..1df030c8eb396d4c77daac1590fbd354fb9b11b3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -464,7 +464,7 @@ void LayoutGrid::repeatTracksSizingIfNeeded(GridSizingData& sizingData,
// all the cases with orthogonal flows require this extra cycle; we need a
// more specific condition to detect whether child's min-content contribution
// has changed or not.
- if (!m_orthogonalChildren.isEmpty()) {
+ if (m_hasAnyOrthogonalChildren) {
computeTrackSizesForDefiniteSize(ForColumns, sizingData,
availableSpaceForColumns);
computeTrackSizesForDefiniteSize(ForRows, sizingData,
@@ -492,13 +492,9 @@ void LayoutGrid::layoutBlock(bool relayoutChildren) {
// computed again in the updateLogicalWidth call bellow.
if (sizesLogicalWidthToFitContent(styleRef().logicalWidth()) ||
styleRef().logicalWidth().isIntrinsicOrAuto()) {
- // We do cache orthogonal items during the placeItemsOnGrid call, which is
- // executed later. However, we are
- // only interested on running this logic when we are performing a
- // relayout, hence we have already cached
- // the orthogonal items.
- for (auto* child : m_orthogonalChildren) {
- if (child->isOutOfFlowPositioned())
+ for (auto* child = firstChildBox(); child;
+ child = child->nextInFlowSiblingBox()) {
+ if (child->isOutOfFlowPositioned() || !isOrthogonalChild(*child))
cbiesinger 2016/10/17 12:16:45 Since you use nextInFlowSiblingBox, do you need th
jfernandez 2016/10/17 12:37:37 You're right. I thought the same, but since we wer
Manuel Rego 2016/10/17 12:40:42 Note that we need to check that firstChildBox() is
jfernandez 2016/10/17 12:43:41 That's true. I think we should change both and jus
continue;
child->clearOverrideSize();
child->clearContainingBlockOverrideSize();
@@ -1932,14 +1928,14 @@ void LayoutGrid::placeItemsOnGrid(SizingOperation sizingOperation) {
Vector<LayoutBox*> autoMajorAxisAutoGridItems;
Vector<LayoutBox*> specifiedMajorAxisAutoGridItems;
- m_orthogonalChildren.shrink(0);
+ m_hasAnyOrthogonalChildren = false;
for (LayoutBox* child = m_orderIterator.first(); child;
child = m_orderIterator.next()) {
if (child->isOutOfFlowPositioned())
continue;
- if (isOrthogonalChild(*child))
- m_orthogonalChildren.append(child);
+ m_hasAnyOrthogonalChildren =
+ m_hasAnyOrthogonalChildren || isOrthogonalChild(*child);
GridArea area = cachedGridArea(*child);
if (!area.rows.isIndefinite())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutGrid.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698