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

Unified Diff: Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp

Issue 1162253006: An object may become a column spanner or cease to be one even if column-span doesn't change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « Source/core/layout/LayoutMultiColumnSpannerPlaceholder.h ('k') | Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp
diff --git a/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp b/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp
index 5f5b00b91bb97e56788f76c300fe39e3c86186e3..bf360b12ef11bb36c39b1b7928a75a6dd45d1148 100644
--- a/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp
+++ b/Source/core/layout/LayoutMultiColumnSpannerPlaceholder.cpp
@@ -34,6 +34,25 @@ LayoutMultiColumnSpannerPlaceholder::LayoutMultiColumnSpannerPlaceholder(LayoutB
{
}
+void LayoutMultiColumnSpannerPlaceholder::layoutObjectInFlowThreadStyleDidChange(const ComputedStyle* oldStyle)
+{
+ LayoutBox* objectInFlowThread = m_layoutObjectInFlowThread;
+ if (flowThread()->removeSpannerPlaceholderIfNoLongerValid(objectInFlowThread)) {
+ // No longer a valid spanner, due to style changes. |this| is now dead.
+ if (objectInFlowThread->style()->hasOutOfFlowPosition() && !oldStyle->hasOutOfFlowPosition()) {
+ // We went from being a spanner to being out-of-flow positioned. When an object becomes
+ // out-of-flow positioned, we need to lay out its parent, since that's where the
+ // now-out-of-flow object gets added to the right containing block for out-of-flow
+ // positioned objects. Since neither a spanner nor an out-of-flow object is guaranteed
+ // to have this parent in its containing block chain, we need to mark it here, or we
+ // risk that the object isn't laid out.
+ objectInFlowThread->parent()->setNeedsLayout(LayoutInvalidationReason::ColumnsChanged);
+ }
+ return;
+ }
+ updateMarginProperties();
+}
+
void LayoutMultiColumnSpannerPlaceholder::updateMarginProperties()
{
RefPtr<ComputedStyle> newStyle = ComputedStyle::clone(styleRef());
@@ -43,8 +62,13 @@ void LayoutMultiColumnSpannerPlaceholder::updateMarginProperties()
void LayoutMultiColumnSpannerPlaceholder::willBeRemovedFromTree()
{
- if (m_layoutObjectInFlowThread)
+ if (m_layoutObjectInFlowThread) {
+ LayoutBox* exSpanner = m_layoutObjectInFlowThread;
m_layoutObjectInFlowThread->clearSpannerPlaceholder();
+ // Even if the placeholder is going away, the object in the flow thread might live on. Since
+ // it's not a spanner anymore, it needs to be relaid out.
+ exSpanner->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::ColumnsChanged);
+ }
LayoutBox::willBeRemovedFromTree();
}
« no previous file with comments | « Source/core/layout/LayoutMultiColumnSpannerPlaceholder.h ('k') | Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698