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

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

Issue 2485173002: Before turning objects into spanners, check that they are not already spanners. (Closed)
Patch Set: Created 4 years, 1 month 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/multicol/dynamic/spanner-change-multicol-writing-mode-crash.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/LayoutMultiColumnFlowThread.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
index 219f1b5a2dc86f37ab7d86f43b2419ea86ae7e54..15f7260c7b10f539f1e48895a4c40d96a4cbe202 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -1191,9 +1191,19 @@ void LayoutMultiColumnFlowThread::toggleSpannersInSubtree(
}
} else if (descendantIsValidColumnSpanner(object)) {
// We can now contain spanners, and we found a candidate. Turn it into a
- // spanner.
- createAndInsertSpannerPlaceholder(
- &box, nextInPreOrderAfterChildrenSkippingOutOfFlow(this, &box));
+ // spanner, if it's not already one. We have to check if it's already a
+ // spanner, because in some cases we incorrectly think that we need to
+ // toggle spanners. One known case is when some ancestor changes
+ // writing-mode (which is an inherited property). Writing mode roots
+ // establish block formatting context (which means that there can be no
+ // column spanners inside). When changing the style on one object in the
+ // tree at a time, we're going to see writing mode roots that are not
+ // going to remain writing mode roots when all objects have been updated
+ // (because then all will have got the same writing mode).
+ if (!box.isColumnSpanAll()) {
+ createAndInsertSpannerPlaceholder(
+ &box, nextInPreOrderAfterChildrenSkippingOutOfFlow(this, &box));
+ }
continue;
}
walkChildren = canContainSpannerInParentFragmentationContext(box);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/dynamic/spanner-change-multicol-writing-mode-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698