| 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 NGLayoutInputNode_h | 5 #ifndef NGLayoutInputNode_h |
| 6 #define NGLayoutInputNode_h | 6 #define NGLayoutInputNode_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class ComputedStyle; | 13 class ComputedStyle; |
| 14 class LayoutObject; | 14 class LayoutObject; |
| 15 class NGBreakToken; | 15 class NGBreakToken; |
| 16 class NGConstraintSpace; | 16 class NGConstraintSpace; |
| 17 class NGLayoutResult; | 17 class NGLayoutResult; |
| 18 struct MinMaxContentSize; | 18 struct MinMaxContentSize; |
| 19 | 19 |
| 20 // Represents the input to a layout algorithm for a given node. The layout | 20 // Represents the input to a layout algorithm for a given node. The layout |
| 21 // engine should use the style, node type to determine which type of layout | 21 // engine should use the style, node type to determine which type of layout |
| 22 // algorithm to use to produce fragments for this node. | 22 // algorithm to use to produce fragments for this node. |
| 23 class CORE_EXPORT NGLayoutInputNode | 23 class CORE_EXPORT NGLayoutInputNode |
| 24 : public GarbageCollectedFinalized<NGLayoutInputNode> { | 24 : public GarbageCollectedFinalized<NGLayoutInputNode> { |
| 25 public: | 25 public: |
| 26 enum NGLayoutInputNodeType { kLegacyBlock = 0, kLegacyInline = 1 }; | 26 enum NGLayoutInputNodeType { kLegacyBlock = 0, kLegacyInline = 1 }; |
| 27 | 27 |
| 28 bool IsInline() { return type_ == kLegacyInline; } | 28 bool IsInline() const { return type_ == kLegacyInline; } |
| 29 | 29 |
| 30 bool IsBlock() { return type_ == kLegacyBlock; } | 30 bool IsBlock() const { return type_ == kLegacyBlock; } |
| 31 | 31 |
| 32 virtual ~NGLayoutInputNode(){}; | 32 virtual ~NGLayoutInputNode(){}; |
| 33 | 33 |
| 34 // Performs layout on this input node, will return the layout result. | 34 // Performs layout on this input node, will return the layout result. |
| 35 virtual RefPtr<NGLayoutResult> Layout(NGConstraintSpace*, NGBreakToken*) = 0; | 35 virtual RefPtr<NGLayoutResult> Layout(NGConstraintSpace*, NGBreakToken*) = 0; |
| 36 | 36 |
| 37 // Returns the next sibling. | 37 // Returns the next sibling. |
| 38 virtual NGLayoutInputNode* NextSibling() = 0; | 38 virtual NGLayoutInputNode* NextSibling() = 0; |
| 39 | 39 |
| 40 // Returns the LayoutObject which is associated with this node. | 40 // Returns the LayoutObject which is associated with this node. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 protected: | 53 protected: |
| 54 explicit NGLayoutInputNode(NGLayoutInputNodeType type) : type_(type) {} | 54 explicit NGLayoutInputNode(NGLayoutInputNodeType type) : type_(type) {} |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 unsigned type_ : 1; | 57 unsigned type_ : 1; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| 61 | 61 |
| 62 #endif // NGLayoutInputNode_h | 62 #endif // NGLayoutInputNode_h |
| OLD | NEW |