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_block_layout_algorithm.h" | 7 #include "core/layout/ng/ng_block_layout_algorithm.h" |
8 #include "core/layout/ng/ng_fragment.h" | 8 #include "core/layout/ng/ng_fragment.h" |
9 #include "core/layout/LayoutAnalyzer.h" | 9 #include "core/layout/LayoutAnalyzer.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element) | 13 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element) |
14 : LayoutBlockFlow(element) {} | 14 : LayoutBlockFlow(element) {} |
15 | 15 |
16 bool LayoutNGBlockFlow::isOfType(LayoutObjectType type) const { | 16 bool LayoutNGBlockFlow::isOfType(LayoutObjectType type) const { |
17 return type == LayoutObjectNGBlockFlow || LayoutBlockFlow::isOfType(type); | 17 return type == LayoutObjectNGBlockFlow || LayoutBlockFlow::isOfType(type); |
18 } | 18 } |
19 | 19 |
20 void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) { | 20 void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) { |
21 LayoutAnalyzer::BlockScope analyzer(*this); | 21 LayoutAnalyzer::BlockScope analyzer(*this); |
22 | 22 |
23 const auto* constraint_space = | 23 const auto* constraint_space = |
24 NGConstraintSpace::CreateFromLayoutObject(*this); | 24 NGConstraintSpace::CreateFromLayoutObject(*this); |
25 NGBox* box = new NGBox(this); | 25 NGBox* box = new NGBox(this); |
26 NGFragment* fragment; | 26 while (!box->Layout(constraint_space)) |
27 while (!box->Layout(constraint_space, &fragment)) | |
28 ; | 27 ; |
29 clearNeedsLayout(); | 28 clearNeedsLayout(); |
30 } | 29 } |
31 | 30 |
32 } // namespace blink | 31 } // namespace blink |
OLD | NEW |