OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef NGOutOfFlowLayoutPart_h | |
6 #define NGOutOfFlowLayoutPart_h | |
7 | |
8 #include "core/CoreExport.h" | |
9 | |
10 #include "core/layout/ng/ng_units.h" | |
11 #include "core/layout/ng/ng_constraint_space.h" | |
12 #include "core/layout/ng/ng_absolute_utils.h" | |
13 #include "core/layout/ng/ng_layout_algorithm.h" | |
14 #include "platform/heap/Handle.h" | |
15 #include "wtf/Optional.h" | |
16 | |
17 namespace blink { | |
18 | |
19 class ComputedStyle; | |
20 class NGBlockNode; | |
21 class NGFragmentBase; | |
22 class NGConstraintSpace; | |
23 | |
24 // Helper class for positioning of out-of-flow blocks. | |
25 // It should be used together with NGFragmentBuilder. | |
26 // See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation | |
27 // for example of using these classes together. | |
28 class CORE_EXPORT NGOutOfFlowLayoutPart | |
29 : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> { | |
30 public: | |
31 NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize); | |
32 | |
33 // If false, this fragment should be passed up the tree for layout by | |
34 // an ancestor. | |
35 bool StartLayout(NGBlockNode*, const NGStaticPosition&); | |
36 // @return true if layout is complete. | |
cbiesinger
2017/01/04 00:13:16
This is now outdated
atotic
2017/01/04 01:34:35
removed.
| |
37 NGLayoutStatus Layout(NGFragmentBase**, NGLogicalOffset*); | |
38 | |
39 DECLARE_TRACE(); | |
40 | |
41 private: | |
42 bool ComputeInlineSizeEstimate(); | |
43 bool ComputeBlockSizeEstimate(); | |
44 bool ComputeNodeFragment(); | |
45 | |
46 bool contains_fixed_; | |
47 bool contains_absolute_; | |
48 | |
49 enum State { | |
50 kComputeInlineEstimate, | |
51 kPartialPosition, | |
52 kComputeBlockEstimate, | |
53 kFullPosition, | |
54 kGenerateFragment, | |
55 kDone | |
56 }; | |
57 State state_; | |
58 | |
59 NGStaticPosition static_position_; | |
60 NGLogicalOffset parent_offset_; | |
61 NGPhysicalOffset parent_physical_offset_; | |
62 Member<NGConstraintSpace> parent_space_; | |
63 Member<NGBlockNode> node_; | |
64 Member<NGConstraintSpace> node_space_; | |
65 Member<NGFragmentBase> node_fragment_; | |
66 NGAbsolutePhysicalPosition node_position_; | |
67 Optional<LayoutUnit> inline_estimate_; | |
68 Optional<LayoutUnit> block_estimate_; | |
69 }; | |
70 | |
71 } // namespace blink | |
72 | |
73 #endif | |
OLD | NEW |