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 db381a810e2202fa81cdfe15b9fbeeef4d2ef18e..c9cc84b668b8efaaecd62ddec9284af6098e7748 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
@@ -71,17 +71,21 @@ LayoutGrid* LayoutGrid::createAnonymous(Document* document) { |
void LayoutGrid::addChild(LayoutObject* newChild, LayoutObject* beforeChild) { |
LayoutBlock::addChild(newChild, beforeChild); |
- // The grid needs to be recomputed as it might contain auto-placed items that |
- // will change their position. |
- dirtyGrid(); |
+ if (!newChild->isOutOfFlowPositioned()) { |
jfernandez
2017/03/15 09:26:36
I think it'd be useful to add comment explaining w
Manuel Rego
2017/03/15 10:59:26
Done.
|
+ // The grid needs to be recomputed as it might contain auto-placed items |
+ // that will change their position. |
+ dirtyGrid(); |
+ } |
svillar
2017/03/15 10:03:54
Better to early return
if (newChild->isOutOfFlowP
Manuel Rego
2017/03/15 10:59:26
Acknowledged.
|
} |
void LayoutGrid::removeChild(LayoutObject* child) { |
LayoutBlock::removeChild(child); |
- // The grid needs to be recomputed as it might contain auto-placed items that |
- // will change their position. |
- dirtyGrid(); |
+ if (!child->isOutOfFlowPositioned()) { |
+ // The grid needs to be recomputed as it might contain auto-placed items |
+ // that will change their position. |
+ dirtyGrid(); |
+ } |
svillar
2017/03/15 10:03:54
Ditto.
Manuel Rego
2017/03/15 10:59:26
Acknowledged.
|
} |
void LayoutGrid::styleDidChange(StyleDifference diff, |