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

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

Issue 2847823002: Make leading OOF objects to be handled by block layout in LayoutNG (Closed)
Patch Set: fix NGBlockNodeForTest Created 3 years, 7 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 bbd61ec7daee402fd6fceb1ae045ec573c505fb3..292c002eae77a39145ea50fdfe14a12dbf6b4580 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() const {
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, ToLayoutNGBlockFlow(layout_box_));
} else {

Powered by Google App Engine
This is Rietveld 408576698