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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Helper class for positioning of out-of-flow blocks. | 24 // Helper class for positioning of out-of-flow blocks. |
25 // It should be used together with NGFragmentBuilder. | 25 // It should be used together with NGFragmentBuilder. |
26 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation | 26 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation |
27 // for example of using these classes together. | 27 // for example of using these classes together. |
28 class CORE_EXPORT NGOutOfFlowLayoutPart | 28 class CORE_EXPORT NGOutOfFlowLayoutPart |
29 : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> { | 29 : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> { |
30 public: | 30 public: |
31 NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize); | 31 NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize); |
32 | 32 |
33 // If false, this fragment should be passed up the tree for layout by | 33 void Layout(NGBlockNode&, NGStaticPosition, NGFragment**, NGLogicalOffset*); |
34 // an ancestor. | |
35 bool StartLayout(NGBlockNode*, const NGStaticPosition&); | |
36 NGLayoutStatus Layout(NGFragment**, NGLogicalOffset*); | |
37 | 34 |
38 DECLARE_TRACE(); | 35 DECLARE_TRACE(); |
39 | 36 |
40 private: | 37 private: |
41 bool ComputeInlineSizeEstimate(); | 38 NGFragment* GenerateFragment(NGBlockNode& node, |
42 bool ComputeBlockSizeEstimate(); | 39 const Optional<LayoutUnit>& block_estimate, |
43 bool ComputeNodeFragment(); | 40 const NGAbsolutePhysicalPosition node_position); |
44 | 41 |
45 bool contains_fixed_; | 42 NGLogicalOffset parent_border_offset_; |
46 bool contains_absolute_; | 43 NGPhysicalOffset parent_border_physical_offset_; |
47 | |
48 enum State { | |
49 kComputeInlineEstimate, | |
50 kPartialPosition, | |
51 kComputeBlockEstimate, | |
52 kFullPosition, | |
53 kGenerateFragment, | |
54 kDone | |
55 }; | |
56 State state_; | |
57 | |
58 NGStaticPosition static_position_; | |
59 NGLogicalOffset parent_offset_; | |
60 NGPhysicalOffset parent_physical_offset_; | |
61 Member<NGConstraintSpace> parent_space_; | 44 Member<NGConstraintSpace> parent_space_; |
62 Member<NGBlockNode> node_; | |
63 Member<NGConstraintSpace> node_space_; | |
64 Member<NGFragment> node_fragment_; | |
65 NGAbsolutePhysicalPosition node_position_; | |
66 Optional<MinAndMaxContentSizes> inline_estimate_; | |
67 Optional<LayoutUnit> block_estimate_; | |
68 }; | 45 }; |
69 | 46 |
70 } // namespace blink | 47 } // namespace blink |
71 | 48 |
72 #endif | 49 #endif |
OLD | NEW |