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/ng/ng_layout_input_node.h" | 9 #include "core/layout/ng/ng_layout_input_node.h" |
10 #include "core/layout/ng/ng_physical_box_fragment.h" | 10 #include "core/layout/ng/ng_physical_box_fragment.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 | 80 |
81 void UpdateLayoutBox(NGPhysicalBoxFragment* fragment, | 81 void UpdateLayoutBox(NGPhysicalBoxFragment* fragment, |
82 const NGConstraintSpace* constraint_space); | 82 const NGConstraintSpace* constraint_space); |
83 | 83 |
84 private: | 84 private: |
85 // This is necessary for interop between old and new trees -- after our parent | 85 // This is necessary for interop between old and new trees -- after our parent |
86 // positions us, it calls this function so we can store the position on the | 86 // positions us, it calls this function so we can store the position on the |
87 // underlying LayoutBox. | 87 // underlying LayoutBox. |
88 void PositionUpdated(); | 88 void PositionUpdated(); |
89 | 89 |
90 void FloatPositionUpdated(LayoutObject* parent); | |
ikilpatrick
2017/01/20 00:03:17
maybe additional comment here or within the functi
Gleb Lanbin
2017/01/20 00:45:27
Done.
| |
91 | |
90 bool CanUseNewLayout(); | 92 bool CanUseNewLayout(); |
91 bool HasInlineChildren(); | 93 bool HasInlineChildren(); |
92 | 94 |
93 // After we run the layout algorithm, this function copies back the geometry | 95 // After we run the layout algorithm, this function copies back the geometry |
94 // data to the layout box. | 96 // data to the layout box. |
95 void CopyFragmentDataToLayoutBox(const NGConstraintSpace&); | 97 void CopyFragmentDataToLayoutBox(const NGConstraintSpace&); |
96 | 98 |
97 // We can either wrap a layout_box_ or a style_/next_sibling_/first_child_ | 99 // We can either wrap a layout_box_ or a style_/next_sibling_/first_child_ |
98 // combination. | 100 // combination. |
99 LayoutBox* layout_box_; | 101 LayoutBox* layout_box_; |
100 RefPtr<ComputedStyle> style_; | 102 RefPtr<ComputedStyle> style_; |
101 Member<NGBlockNode> next_sibling_; | 103 Member<NGBlockNode> next_sibling_; |
102 Member<NGLayoutInputNode> first_child_; | 104 Member<NGLayoutInputNode> first_child_; |
103 Member<NGLayoutCoordinator> layout_coordinator_; | 105 Member<NGLayoutCoordinator> layout_coordinator_; |
104 // TODO(mstensho): An input node may produce multiple fragments, so this | 106 // TODO(mstensho): An input node may produce multiple fragments, so this |
105 // should probably be renamed to last_fragment_ or something like that, since | 107 // should probably be renamed to last_fragment_ or something like that, since |
106 // the last fragment is all we care about when resuming layout. | 108 // the last fragment is all we care about when resuming layout. |
107 Member<NGPhysicalBoxFragment> fragment_; | 109 Member<NGPhysicalBoxFragment> fragment_; |
108 }; | 110 }; |
109 | 111 |
110 DEFINE_TYPE_CASTS(NGBlockNode, | 112 DEFINE_TYPE_CASTS(NGBlockNode, |
111 NGLayoutInputNode, | 113 NGLayoutInputNode, |
112 node, | 114 node, |
113 node->Type() == NGLayoutInputNode::kLegacyBlock, | 115 node->Type() == NGLayoutInputNode::kLegacyBlock, |
114 node.Type() == NGLayoutInputNode::kLegacyBlock); | 116 node.Type() == NGLayoutInputNode::kLegacyBlock); |
115 | 117 |
116 } // namespace blink | 118 } // namespace blink |
117 | 119 |
118 #endif // NGBlockNode | 120 #endif // NGBlockNode |
OLD | NEW |