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

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

Issue 1421423003: Require spanners to have the multicol container as their nearest block formatting context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test for bug 529737 Created 5 years, 2 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/LayoutBlock.h ('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 33dd01e387390e3668420c2804ef0f024a29c059..950e16c653dd73f1f5c383ad7f4fe67a3d659809 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -590,29 +590,17 @@ bool LayoutMultiColumnFlowThread::descendantIsValidColumnSpanner(LayoutObject* d
return false;
}
- // This looks like a spanner, but if we're inside something unbreakable, it's not to be treated as one.
+ // This looks like a spanner, but if we're inside something unbreakable or something that
+ // establishes a new formatting context, it's not to be treated as one.
for (LayoutBox* ancestor = toLayoutBox(descendant)->parentBox(); ancestor; ancestor = ancestor->containingBlock()) {
if (ancestor->isLayoutFlowThread()) {
ASSERT(ancestor == this);
return true;
}
- if (ancestor->spannerPlaceholder()) {
- // FIXME: do we want to support nested spanners in a different way? The outer spanner
- // has already broken out from the columns to become sized by the multicol container,
- // which may be good enough for the inner spanner. But margins, borders, padding and
- // explicit widths on the outer spanner, or on any children between the outer and inner
- // spanner, will affect the width of the inner spanner this way, which might be
- // undesirable. The spec has nothing to say on the matter.
- return false; // Ignore nested spanners.
- }
- if (ancestor->isFloatingOrOutOfFlowPositioned()) {
- // TODO(mstensho): It could actually be nice to support this (although the usefulness is
- // probably very limited), but currently our column balancing algorithm gets confused
- // when a spanner is inside a float, because a float's position isn't always known until
- // after layout. Similarly for absolutely positioned boxes.
+ if (!ancestor->isLayoutBlockFlow())
return false;
- }
- if (ancestor->isUnsplittableForPagination())
+ const LayoutBlockFlow& ancestorBlockFlow = *toLayoutBlockFlow(ancestor);
+ if (ancestorBlockFlow.createsNewFormattingContext() || ancestorBlockFlow.isUnsplittableForPagination())
return false;
}
ASSERT_NOT_REACHED();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698