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

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

Issue 2438253003: [css-grid] Use order-modified document order for m_gridItemsIndexesMap (Closed)
Patch Set: 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 | « no previous file | third_party/WebKit/Source/core/paint/GridPainter.cpp » ('j') | 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 26b4afd42c9f6a66f70e7a0e1a2aeccb0f5cc909..47d8a7f295e4360e46ee4756e91a1e8bf0f3bcf3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1922,7 +1922,6 @@ void LayoutGrid::placeItemsOnGrid() {
return;
DCHECK(m_gridItemArea.isEmpty());
- DCHECK(m_gridItemsIndexesMap.isEmpty());
populateExplicitGridAndOrderIterator();
@@ -1931,12 +1930,16 @@ void LayoutGrid::placeItemsOnGrid() {
Vector<LayoutBox*> autoMajorAxisAutoGridItems;
Vector<LayoutBox*> specifiedMajorAxisAutoGridItems;
+ DCHECK(m_gridItemsIndexesMap.isEmpty());
+ size_t childIndex = 0;
m_hasAnyOrthogonalChildren = false;
for (LayoutBox* child = m_orderIterator.first(); child;
child = m_orderIterator.next()) {
if (child->isOutOfFlowPositioned())
continue;
+ m_gridItemsIndexesMap.set(child, childIndex++);
+
m_hasAnyOrthogonalChildren =
m_hasAnyOrthogonalChildren || isOrthogonalChild(*child);
@@ -1997,12 +2000,9 @@ void LayoutGrid::populateExplicitGridAndOrderIterator() {
size_t maximumColumnIndex = GridPositionsResolver::explicitGridColumnCount(
*style(), m_autoRepeatColumns);
- ASSERT(m_gridItemsIndexesMap.isEmpty());
- size_t childIndex = 0;
for (LayoutBox* child = firstInFlowChildBox(); child;
child = child->nextInFlowSiblingBox()) {
populator.collectChild(child);
- m_gridItemsIndexesMap.set(child, childIndex++);
// This function bypasses the cache (cachedGridArea()) as it is used to
// build it.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/GridPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698