| 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(); |
| 66 | 65 |
| 66 private: |
| 67 // After we run the layout algorithm, this function copies back the geometry | 67 // After we run the layout algorithm, this function copies back the geometry |
| 68 // data to the layout box. | 68 // data to the layout box. |
| 69 void CopyFragmentDataToLayoutBox(const NGConstraintSpace&, NGLayoutResult*); | 69 void CopyFragmentDataToLayoutBox(const NGConstraintSpace&, NGLayoutResult*); |
| 70 | 70 |
| 71 // We can either wrap a layout_box_ or a next_sibling_/first_child_ | 71 // We can either wrap a layout_box_ or a next_sibling_/first_child_ |
| 72 // combination. | 72 // combination. |
| 73 LayoutBox* layout_box_; | 73 LayoutBox* layout_box_; |
| 74 Member<NGLayoutInputNode> next_sibling_; | 74 Member<NGLayoutInputNode> next_sibling_; |
| 75 Member<NGLayoutInputNode> first_child_; | 75 Member<NGLayoutInputNode> first_child_; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 DEFINE_TYPE_CASTS(NGBlockNode, | 78 DEFINE_TYPE_CASTS(NGBlockNode, |
| 79 NGLayoutInputNode, | 79 NGLayoutInputNode, |
| 80 node, | 80 node, |
| 81 node->IsBlock(), | 81 node->IsBlock(), |
| 82 node.IsBlock()); | 82 node.IsBlock()); |
| 83 | 83 |
| 84 } // namespace blink | 84 } // namespace blink |
| 85 | 85 |
| 86 #endif // NGBlockNode | 86 #endif // NGBlockNode |
| OLD | NEW |