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

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

Issue 1929483002: [css-grid] Fix static position for positioned grid items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html ('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 cd8e759b22198378c0d7379bdfa4fffbe1507628..d5f093b6d2ab785721b99d0421ef90e8141e6cde 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1554,6 +1554,12 @@ void LayoutGrid::layoutPositionedObjects(bool relayoutChildren, PositionedLayout
child->setOverrideContainingBlockContentLogicalHeight(rowBreadth);
child->setExtraInlineOffset(columnOffset);
child->setExtraBlockOffset(rowOffset);
+
+ if (child->parent() == this) {
+ PaintLayer* childLayer = child->layer();
+ childLayer->setStaticInlinePosition(borderStart() + columnOffset);
+ childLayer->setStaticBlockPosition(borderBefore() + rowOffset);
+ }
}
LayoutBlock::layoutPositionedObjects(relayoutChildren, info);
@@ -1641,14 +1647,6 @@ void LayoutGrid::offsetAndBreadthForPositionedChild(const LayoutBox& child, Grid
}
}
- if (child.parent() == this && !startIsAuto) {
- // If column/row start is "auto" the static position has been already set in prepareChildForPositionedLayout().
- PaintLayer* childLayer = child.layer();
- if (isForColumns)
- childLayer->setStaticInlinePosition(borderStart() + offset);
- else
- childLayer->setStaticBlockPosition(borderBefore() + offset);
- }
}
GridArea LayoutGrid::cachedGridArea(const LayoutBox& gridItem) const
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698