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/ng/ng_layout_input_node.h" | 10 #include "core/layout/ng/ng_layout_input_node.h" |
10 #include "core/layout/ng/ng_physical_box_fragment.h" | 11 #include "core/layout/ng/ng_physical_box_fragment.h" |
11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class ComputedStyle; | 16 class ComputedStyle; |
16 class LayoutBox; | |
17 class LayoutObject; | 17 class LayoutObject; |
18 class NGBreakToken; | 18 class NGBreakToken; |
19 class NGConstraintSpace; | 19 class NGConstraintSpace; |
20 struct NGLogicalOffset; | 20 struct NGLogicalOffset; |
21 class NGPhysicalFragment; | 21 class NGPhysicalFragment; |
22 struct MinAndMaxContentSizes; | 22 struct MinAndMaxContentSizes; |
23 | 23 |
24 // Represents a node to be laid out. | 24 // Represents a node to be laid out. |
25 class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { | 25 class CORE_EXPORT NGBlockNode final : public NGLayoutInputNode { |
26 friend NGLayoutInputNode; | 26 friend NGLayoutInputNode; |
(...skipping 25 matching lines...) Expand all Loading... |
52 | 52 |
53 void SetNextSibling(NGBlockNode*); | 53 void SetNextSibling(NGBlockNode*); |
54 void SetFirstChild(NGLayoutInputNode*); | 54 void SetFirstChild(NGLayoutInputNode*); |
55 | 55 |
56 void SetFragment(NGPhysicalBoxFragment* fragment) { fragment_ = fragment; } | 56 void SetFragment(NGPhysicalBoxFragment* fragment) { fragment_ = fragment; } |
57 NGBreakToken* CurrentBreakToken() const; | 57 NGBreakToken* CurrentBreakToken() const; |
58 bool IsLayoutFinished() const { | 58 bool IsLayoutFinished() const { |
59 return fragment_ && !fragment_->BreakToken(); | 59 return fragment_ && !fragment_->BreakToken(); |
60 } | 60 } |
61 | 61 |
| 62 // Used for debugging purposes only. |
| 63 const LayoutBox* LegacyLayoutBox() const { return layout_box_; } |
| 64 |
62 DECLARE_VIRTUAL_TRACE(); | 65 DECLARE_VIRTUAL_TRACE(); |
63 | 66 |
64 // Runs layout on layout_box_ and creates a fragment for the resulting | 67 // Runs layout on layout_box_ and creates a fragment for the resulting |
65 // geometry. | 68 // geometry. |
66 RefPtr<NGPhysicalBoxFragment> RunOldLayout(const NGConstraintSpace&); | 69 RefPtr<NGPhysicalBoxFragment> RunOldLayout(const NGConstraintSpace&); |
67 | 70 |
68 // Called if this is an out-of-flow block which needs to be | 71 // Called if this is an out-of-flow block which needs to be |
69 // positioned with legacy layout. | 72 // positioned with legacy layout. |
70 void UseOldOutOfFlowPositioning(); | 73 void UseOldOutOfFlowPositioning(); |
71 | 74 |
(...skipping 22 matching lines...) Expand all Loading... |
94 | 97 |
95 DEFINE_TYPE_CASTS(NGBlockNode, | 98 DEFINE_TYPE_CASTS(NGBlockNode, |
96 NGLayoutInputNode, | 99 NGLayoutInputNode, |
97 node, | 100 node, |
98 node->Type() == NGLayoutInputNode::kLegacyBlock, | 101 node->Type() == NGLayoutInputNode::kLegacyBlock, |
99 node.Type() == NGLayoutInputNode::kLegacyBlock); | 102 node.Type() == NGLayoutInputNode::kLegacyBlock); |
100 | 103 |
101 } // namespace blink | 104 } // namespace blink |
102 | 105 |
103 #endif // NGBlockNode | 106 #endif // NGBlockNode |
OLD | NEW |