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

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

Issue 2684073004: [css-flexbox] Clear override sizes when we're no longer a flex item (Closed)
Patch Set: Created 3 years, 10 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/css3/flexbox/change-flexitem-into-abspos.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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 882eadfab0ba37ccc82799febfbb9f140d5083b5..ae34a224b2d83e072903c8fe5f1df443046a3b7b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -312,6 +312,14 @@ void LayoutBox::styleDidChange(StyleDifference diff,
updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
updateGridPositionAfterStyleChange(oldStyle);
+ // When we're no longer a flex item because we're now absolutely positioned,
+ // we need to clear the override size so we're not affected by it anymore.
+ // This technically covers too many cases (even when out-of-flow did not
+ // change) but that should be harmless.
+ if (isOutOfFlowPositioned() && parent() &&
+ parent()->styleRef().isDisplayFlexibleOrGridBox())
+ clearOverrideSize();
+
if (LayoutMultiColumnSpannerPlaceholder* placeholder =
this->spannerPlaceholder())
placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle);
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/change-flexitem-into-abspos.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698