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 #ifndef NGOutOfFlowLayoutPart_h | 5 #ifndef NGOutOfFlowLayoutPart_h |
6 #define NGOutOfFlowLayoutPart_h | 6 #define NGOutOfFlowLayoutPart_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 | 9 |
10 #include "core/layout/ng/ng_absolute_utils.h" | 10 #include "core/layout/ng/ng_absolute_utils.h" |
11 #include "core/layout/ng/ng_constraint_space.h" | 11 #include "core/layout/ng/ng_constraint_space.h" |
12 #include "core/layout/ng/ng_layout_algorithm.h" | 12 #include "core/layout/ng/ng_layout_algorithm.h" |
13 #include "core/layout/ng/ng_units.h" | 13 #include "core/layout/ng/ng_units.h" |
14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
15 #include "wtf/Optional.h" | 15 #include "wtf/Optional.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class ComputedStyle; | 19 class ComputedStyle; |
20 class NGBlockNode; | 20 class NGBlockNode; |
21 class NGFragmentBuilder; | 21 class NGFragmentBuilder; |
22 class NGConstraintSpace; | 22 class NGConstraintSpace; |
| 23 class NGLayoutResult; |
23 | 24 |
24 // Helper class for positioning of out-of-flow blocks. | 25 // Helper class for positioning of out-of-flow blocks. |
25 // It should be used together with NGFragmentBuilder. | 26 // It should be used together with NGFragmentBuilder. |
26 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation | 27 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation |
27 // for example of using these classes together. | 28 // for example of using these classes together. |
28 class CORE_EXPORT NGOutOfFlowLayoutPart { | 29 class CORE_EXPORT NGOutOfFlowLayoutPart { |
29 STACK_ALLOCATED(); | 30 STACK_ALLOCATED(); |
30 | 31 |
31 public: | 32 public: |
32 NGOutOfFlowLayoutPart(const ComputedStyle& container_style, | 33 NGOutOfFlowLayoutPart(const ComputedStyle& container_style, |
33 NGFragmentBuilder* container_builder); | 34 NGFragmentBuilder* container_builder); |
34 void Run(); | 35 void Run(); |
35 | 36 |
36 private: | 37 private: |
37 RefPtr<NGPhysicalFragment> LayoutDescendant(NGBlockNode& descendant, | 38 RefPtr<NGLayoutResult> LayoutDescendant(NGBlockNode& descendant, |
38 NGStaticPosition static_position, | 39 NGStaticPosition static_position, |
39 NGLogicalOffset* offset); | 40 NGLogicalOffset* offset); |
40 | 41 |
41 RefPtr<NGPhysicalFragment> GenerateFragment( | 42 RefPtr<NGLayoutResult> GenerateFragment( |
42 NGBlockNode& node, | 43 NGBlockNode& node, |
43 const Optional<LayoutUnit>& block_estimate, | 44 const Optional<LayoutUnit>& block_estimate, |
44 const NGAbsolutePhysicalPosition node_position); | 45 const NGAbsolutePhysicalPosition node_position); |
45 | 46 |
46 const ComputedStyle& container_style_; | 47 const ComputedStyle& container_style_; |
47 NGFragmentBuilder* container_builder_; | 48 NGFragmentBuilder* container_builder_; |
48 | 49 |
49 NGLogicalOffset container_border_offset_; | 50 NGLogicalOffset container_border_offset_; |
50 NGPhysicalOffset container_border_physical_offset_; | 51 NGPhysicalOffset container_border_physical_offset_; |
51 Member<NGConstraintSpace> container_space_; | 52 Member<NGConstraintSpace> container_space_; |
52 }; | 53 }; |
53 | 54 |
54 } // namespace blink | 55 } // namespace blink |
55 | 56 |
56 #endif | 57 #endif |
OLD | NEW |