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

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

Issue 1908393002: Don't allow column spanners inside transforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Documentation. Created 4 years, 8 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/fast/multicol/span/invalid-spanner-in-transform-expected.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 ea48c2380e124d0da0c44b8e16061b2ed5f886ba..49e32ba7cfd9da5198502ce6e4160cc5e0fdb24b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -81,12 +81,25 @@ static inline bool isMultiColumnContainer(const LayoutObject& object)
return toLayoutBlockFlow(object).multiColumnFlowThread();
}
+// Return true if there's nothing that prevents the specified object from being in the ancestor
+// chain between some column spanner and its containing multicol container. A column spanner needs
+// the multicol container to be its containing block, so that the spanner is able to escape the flow
+// thread. (Everything contained by the flow thread is split into columns, but this is precisely
+// what shouldn't be done to a spanner, since it's supposed to span all columns.)
+//
+// We require that the parent of the spanner participate in the block formatting context established
+// by the multicol container (i.e. that there are no BFCs or other formatting contexts
+// in-between). We also require that there be no transforms, since transforms insist on being in the
+// containing block chain for everything inside it, which conflicts with a spanners's need to have
+// the multicol container as its direct containing block. We may also not put spanners inside
+// objects that don't support fragmentation.
static inline bool canContainSpannerInParentFragmentationContext(const LayoutObject& object)
{
if (!object.isLayoutBlockFlow())
return false;
const LayoutBlockFlow& blockFlow = toLayoutBlockFlow(object);
return !blockFlow.createsNewFormattingContext()
+ && !blockFlow.hasTransformRelatedProperty()
&& blockFlow.getPaginationBreakability() != LayoutBox::ForbidBreaks
&& !isMultiColumnContainer(blockFlow);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/span/invalid-spanner-in-transform-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698