OLD | NEW |
---|---|
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 // const HeapLinkedHashSet<WeakMember<NGBlockNode>>& oof_descendants = | |
34 // fragment->PhysicalFragment()->OutOfFlowDescendants(); | |
ikilpatrick
2016/12/13 18:28:27
why is this commented out?
atotic
2016/12/13 19:19:41
because oops. fixed.
| |
35 for (auto& descendant : fragment->PhysicalFragment()->OutOfFlowDescendants()) | |
36 descendant->UseOldOutOfFlowPositioning(); | |
31 clearNeedsLayout(); | 37 clearNeedsLayout(); |
32 } | 38 } |
33 | 39 |
34 } // namespace blink | 40 } // namespace blink |
OLD | NEW |