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

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

Issue 2954433003: [LayoutNG] Make leading OOF objects not to create context
Patch Set: Created 3 years, 6 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 | « no previous file | third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 0b1a11fa1a98f565256a2c16c4dcd9e8243918d9..57c2e41f9d8c112a52c45ccf5d9d1095079060af 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -3000,29 +3000,8 @@ void LayoutBlockFlow::AddChild(LayoutObject* new_child,
// children as blocks.
// So, if our children are currently inline and a block child has to be
// inserted, we move all our inline children into anonymous block boxes.
- bool child_is_block_level = !new_child->IsInline();
-
- // ** LayoutNG **
- // We want to use the block layout for out of flow positioned
- // objects when they go in front of inline blocks or if they are just
- // standalone objects.
- // Example 1:
- // <div id="zero"><div id="oof"></div></div>
- // Legacy Layout: #oof is in inline context.
- // LayoutNG: #oof is in block context.
- //
- // Example 2:
- // <div id=container><oof></oof>Hello!</div>
- // Legacy Layout: oof is in inline context.
- // LayoutNG: oof is in block context.
- //
- // Example 3:
- // <div id=container>Hello!<oof></oof></div>
- // Legacy Layout: oof is in inline context.
- // LayoutNG: oof is in inline context.
- bool layout_ng_enabled = RuntimeEnabledFeatures::LayoutNGEnabled();
- if (new_child->IsFloatingOrOutOfFlowPositioned())
- child_is_block_level = layout_ng_enabled && !FirstChild();
+ bool child_is_block_level =
+ !new_child->IsInline() && !new_child->IsFloatingOrOutOfFlowPositioned();
if (ChildrenInline()) {
if (child_is_block_level) {
@@ -3057,8 +3036,7 @@ void LayoutBlockFlow::AddChild(LayoutObject* new_child,
LayoutBlockFlow* new_block = ToLayoutBlockFlow(CreateAnonymousBlock());
LayoutBox::AddChild(new_block, before_child);
// Reparent adjacent floating or out-of-flow siblings to the new box.
- if (!layout_ng_enabled)
- new_block->ReparentPrecedingFloatingOrOutOfFlowSiblings();
+ new_block->ReparentPrecedingFloatingOrOutOfFlowSiblings();
new_block->AddChild(new_child);
new_block->ReparentSubsequentFloatingOrOutOfFlowSiblings();
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698