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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc

Issue 2569263002: Legacy out-of-flow descendant propagation (Closed)
Patch Set: CR fixes, wording Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_node.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/ng/layout_ng_block_flow.h" 5 #include "core/layout/ng/layout_ng_block_flow.h"
6 #include "core/layout/ng/ng_constraint_space.h" 6 #include "core/layout/ng/ng_constraint_space.h"
7 #include "core/layout/ng/ng_fragment_base.h"
7 #include "core/layout/LayoutAnalyzer.h" 8 #include "core/layout/LayoutAnalyzer.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element) 12 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element)
12 : LayoutBlockFlow(element) {} 13 : LayoutBlockFlow(element) {}
13 14
14 bool LayoutNGBlockFlow::isOfType(LayoutObjectType type) const { 15 bool LayoutNGBlockFlow::isOfType(LayoutObjectType type) const {
15 return type == LayoutObjectNGBlockFlow || LayoutBlockFlow::isOfType(type); 16 return type == LayoutObjectNGBlockFlow || LayoutBlockFlow::isOfType(type);
16 } 17 }
17 18
18 void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) { 19 void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) {
19 LayoutAnalyzer::BlockScope analyzer(*this); 20 LayoutAnalyzer::BlockScope analyzer(*this);
20 21
21 auto* constraint_space = NGConstraintSpace::CreateFromLayoutObject(*this); 22 auto* constraint_space = NGConstraintSpace::CreateFromLayoutObject(*this);
22 23
23 // TODO(layout-dev): This should be created in the constructor once instead. 24 // TODO(layout-dev): This should be created in the constructor once instead.
24 // There is some internal state which needs to be cleared between layout 25 // There is some internal state which needs to be cleared between layout
25 // passes (probably FirstChild(), etc). 26 // passes (probably FirstChild(), etc).
26 m_box = new NGBlockNode(this); 27 m_box = new NGBlockNode(this);
27 28
28 NGFragmentBase* fragment; 29 NGFragmentBase* fragment;
29 while (!m_box->Layout(constraint_space, &fragment)) 30 while (!m_box->Layout(constraint_space, &fragment))
30 ; 31 ;
32
33 for (auto& descendant : fragment->PhysicalFragment()->OutOfFlowDescendants())
34 descendant->UseOldOutOfFlowPositioning();
31 clearNeedsLayout(); 35 clearNeedsLayout();
32 } 36 }
33 37
34 } // namespace blink 38 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698