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

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

Issue 2665133003: [css-grid] Fix behavior of positioned items without specific dimensions (Closed)
Patch Set: Applied suggested changes Created 3 years, 7 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/LayoutBox.cpp ('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 9b70c14246c0977c6e1645927061b89b3aec95f0..0ff518fe28a25c532e10310d9fda35e48d181872 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1263,16 +1263,17 @@ void LayoutGrid::LayoutPositionedObjects(bool relayout_children,
child->SetOverrideContainingBlockContentLogicalWidth(column_breadth);
child->SetOverrideContainingBlockContentLogicalHeight(row_breadth);
- child->SetExtraInlineOffset(column_offset);
- child->SetExtraBlockOffset(row_offset);
- if (child->Parent() == this) {
- PaintLayer* child_layer = child->Layer();
- child_layer->SetStaticInlinePosition(BorderStart() + column_offset);
- child_layer->SetStaticBlockPosition(BorderBefore() + row_offset);
- }
+ // Mark for layout as we're resetting the position before and we relay in
+ // generic layout logic for positioned items in order to get the offsets
+ // properly resolved.
+ child->SetNeedsLayout(LayoutInvalidationReason::kGridChanged,
+ kMarkOnlyThis);
LayoutPositionedObject(child, relayout_children, info);
+
+ child->SetLogicalLocation(LayoutPoint(child->LogicalLeft() + column_offset,
+ child->LogicalTop() + row_offset));
}
}
@@ -1364,11 +1365,8 @@ void LayoutGrid::OffsetAndBreadthForPositionedChild(
breadth = std::max(end - start, LayoutUnit());
offset = start;
- if (is_for_columns && !StyleRef().IsLeftToRightDirection() &&
- !child.StyleRef().HasStaticInlinePosition(
- child.IsHorizontalWritingMode())) {
- // If the child doesn't have a static inline position (i.e. "left" and/or
- // "right" aren't "auto", we need to calculate the offset from the left
+ if (is_for_columns && !StyleRef().IsLeftToRightDirection()) {
+ // We always want to calculate the static position from the left
// (even if we're in RTL).
if (end_is_auto) {
offset = LayoutUnit();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698