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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc

Issue 2829593002: (CANCELED) [LayoutNG] Use ChildrenInline() to determine if children are inline (Closed)
Patch Set: Add TestExpectations Created 3 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
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 96402b5f64b35d33df7bb8377a1409ecae153d5f..36a3fa547ce57cd2b817ddbf357d9fd624f6fc6d 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -222,32 +222,11 @@ LayoutObject* NGBlockNode::GetLayoutObject() {
return layout_box_;
}
-static bool ShouldHandleByInlineContext(LayoutObject* child) {
- DCHECK(child);
- // The spec isn't clear about whether floats/OOF should be in inline
- // formatting context or in block formatting context.
- // Prefer inline formatting context because 1) floats/OOF at the beginning
- // and in the middle of inline should be handled in the same code, and 2)
- // it matches to the LayoutObject tree.
- for (; child; child = child->NextSibling()) {
- if (child->IsInline())
- return true;
- if (child->IsFloating() || child->IsOutOfFlowPositioned())
- continue;
- return false;
- }
- // All children are either float or OOF.
- // TODO(kojii): Should this be handled in block context or inline context?
- // If we handle in inline, we can remove all code for floats/OOF from block
- // layout, but it may change semantics and causes incorrectness?
- return false;
-}
-
NGLayoutInputNode* NGBlockNode::FirstChild() {
if (!first_child_) {
LayoutObject* child = layout_box_->SlowFirstChild();
if (child) {
- if (ShouldHandleByInlineContext(child)) {
+ if (layout_box_->ChildrenInline()) {
first_child_ = new NGInlineNode(child, ToLayoutBlockFlow(layout_box_));
} else {
first_child_ = new NGBlockNode(child);

Powered by Google App Engine
This is Rietveld 408576698