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

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

Issue 2698243002: Add out-of-flow objects under the inline in a continuation chain, when possible. (Closed)
Patch Set: cleanup 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/fast/inline/add-abspos-before-block-inside-inline-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/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index f7087839bc7458830a8acd88b77d6b38601fb581..1f8ff5a0715aae20d7433a137b14c23821a3eb6b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -571,29 +571,28 @@ void LayoutInline::addChildToContinuation(LayoutObject* newChild,
beforeChildParent = flow;
}
- // TODO(rhogan): Should we treat out-of-flows and floats as through they're
- // inline below?
- if (newChild->isFloatingOrOutOfFlowPositioned())
- return beforeChildParent->addChildIgnoringContinuation(newChild,
- beforeChild);
-
- // A table part will be wrapped by an inline anonymous table when it is added
- // to the layout tree, so treat it as inline when deciding where to add it.
- bool childInline = newChild->isInline() || newChild->isTablePart();
- bool bcpInline = beforeChildParent->isInline();
- bool flowInline = flow->isInline();
-
+ // If the two candidates are the same, no further checking is necessary.
if (flow == beforeChildParent)
return flow->addChildIgnoringContinuation(newChild, beforeChild);
+ // A table part will be wrapped by an inline anonymous table when it is added
+ // to the layout tree, so treat it as inline when deciding where to add
+ // it. Floating and out-of-flow-positioned objects can also live under
+ // inlines, and since this about adding a child to an inline parent, we
+ // should not put them into a block continuation.
+ bool addInsideInline = newChild->isInline() || newChild->isTablePart() ||
+ newChild->isFloatingOrOutOfFlowPositioned();
+
// The goal here is to match up if we can, so that we can coalesce and create
// the minimal # of continuations needed for the inline.
- if (childInline == bcpInline || (beforeChild && beforeChild->isInline()))
+ if (addInsideInline == beforeChildParent->isInline() ||
+ (beforeChild && beforeChild->isInline())) {
return beforeChildParent->addChildIgnoringContinuation(newChild,
beforeChild);
- if (flowInline == childInline) {
+ }
+ if (addInsideInline == flow->isInline()) {
// Just treat like an append.
- return flow->addChildIgnoringContinuation(newChild, 0);
+ return flow->addChildIgnoringContinuation(newChild);
}
return beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/inline/add-abspos-before-block-inside-inline-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698