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 NGBlockNode_h | 5 #ifndef NGBlockNode_h |
6 #define NGBlockNode_h | 6 #define NGBlockNode_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
10 #include "core/layout/ng/ng_layout_input_node.h" | 10 #include "core/layout/ng/ng_layout_input_node.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Runs layout on layout_box_ and creates a fragment for the resulting | 53 // Runs layout on layout_box_ and creates a fragment for the resulting |
54 // geometry. | 54 // geometry. |
55 RefPtr<NGLayoutResult> RunOldLayout(const NGConstraintSpace&); | 55 RefPtr<NGLayoutResult> RunOldLayout(const NGConstraintSpace&); |
56 | 56 |
57 // Called if this is an out-of-flow block which needs to be | 57 // Called if this is an out-of-flow block which needs to be |
58 // positioned with legacy layout. | 58 // positioned with legacy layout. |
59 void UseOldOutOfFlowPositioning(); | 59 void UseOldOutOfFlowPositioning(); |
60 | 60 |
61 // Save static position for legacy AbsPos layout. | 61 // Save static position for legacy AbsPos layout. |
62 void SaveStaticOffsetForLegacy(const NGLogicalOffset&); | 62 void SaveStaticOffsetForLegacy(const NGLogicalOffset&); |
63 private: | |
64 | 63 |
65 bool CanUseNewLayout(); | 64 bool CanUseNewLayout(); |
| 65 |
| 66 private: |
66 bool HasInlineChildren(); | 67 bool HasInlineChildren(); |
67 | 68 |
68 // After we run the layout algorithm, this function copies back the geometry | 69 // After we run the layout algorithm, this function copies back the geometry |
69 // data to the layout box. | 70 // data to the layout box. |
70 void CopyFragmentDataToLayoutBox(const NGConstraintSpace&, NGLayoutResult*); | 71 void CopyFragmentDataToLayoutBox(const NGConstraintSpace&, NGLayoutResult*); |
71 | 72 |
72 // We can either wrap a layout_box_ or a next_sibling_/first_child_ | 73 // We can either wrap a layout_box_ or a next_sibling_/first_child_ |
73 // combination. | 74 // combination. |
74 LayoutBox* layout_box_; | 75 LayoutBox* layout_box_; |
75 Member<NGLayoutInputNode> next_sibling_; | 76 Member<NGLayoutInputNode> next_sibling_; |
76 Member<NGLayoutInputNode> first_child_; | 77 Member<NGLayoutInputNode> first_child_; |
77 }; | 78 }; |
78 | 79 |
79 DEFINE_TYPE_CASTS(NGBlockNode, | 80 DEFINE_TYPE_CASTS(NGBlockNode, |
80 NGLayoutInputNode, | 81 NGLayoutInputNode, |
81 node, | 82 node, |
82 node->Type() == NGLayoutInputNode::kLegacyBlock, | 83 node->Type() == NGLayoutInputNode::kLegacyBlock, |
83 node.Type() == NGLayoutInputNode::kLegacyBlock); | 84 node.Type() == NGLayoutInputNode::kLegacyBlock); |
84 | 85 |
85 } // namespace blink | 86 } // namespace blink |
86 | 87 |
87 #endif // NGBlockNode | 88 #endif // NGBlockNode |
OLD | NEW |