| 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 20 matching lines...) Expand all Loading... |
| 31 // TODO(layout-ng): make it private and declare a friend class to use in tests | 31 // TODO(layout-ng): make it private and declare a friend class to use in tests |
| 32 explicit NGBlockNode(ComputedStyle*); | 32 explicit NGBlockNode(ComputedStyle*); |
| 33 | 33 |
| 34 ~NGBlockNode() override; | 34 ~NGBlockNode() override; |
| 35 | 35 |
| 36 NGPhysicalFragment* Layout(NGConstraintSpace* constraint_space) override; | 36 NGPhysicalFragment* Layout(NGConstraintSpace* constraint_space) override; |
| 37 NGBlockNode* NextSibling() override; | 37 NGBlockNode* NextSibling() override; |
| 38 LayoutObject* GetLayoutObject() override; | 38 LayoutObject* GetLayoutObject() override; |
| 39 | 39 |
| 40 // Computes the value of min-content and max-content for this box. | 40 // Computes the value of min-content and max-content for this box. |
| 41 // The return value has the same meaning as for Layout. | |
| 42 // If the underlying layout algorithm returns NotImplemented from | 41 // If the underlying layout algorithm returns NotImplemented from |
| 43 // ComputeMinAndMaxContentSizes, this function will synthesize these sizes | 42 // ComputeMinAndMaxContentSizes, this function will synthesize these sizes |
| 44 // using Layout with special constraint spaces. | 43 // using Layout with special constraint spaces. |
| 45 // It is not legal to interleave a pending Layout() with a pending | 44 MinAndMaxContentSizes ComputeMinAndMaxContentSizes(); |
| 46 // ComputeOrSynthesizeMinAndMaxContentSizes (i.e. you have to call Layout | |
| 47 // often enough that it returns true before calling | |
| 48 // ComputeOrSynthesizeMinAndMaxContentSizes) | |
| 49 bool ComputeMinAndMaxContentSizes(MinAndMaxContentSizes*); | |
| 50 MinAndMaxContentSizes ComputeMinAndMaxContentSizesSync(); | |
| 51 | 45 |
| 52 const ComputedStyle* Style() const; | 46 const ComputedStyle* Style() const; |
| 53 ComputedStyle* MutableStyle(); | 47 ComputedStyle* MutableStyle(); |
| 54 | 48 |
| 55 NGLayoutInputNode* FirstChild(); | 49 NGLayoutInputNode* FirstChild(); |
| 56 | 50 |
| 57 void SetNextSibling(NGBlockNode*); | 51 void SetNextSibling(NGBlockNode*); |
| 58 void SetFirstChild(NGLayoutInputNode*); | 52 void SetFirstChild(NGLayoutInputNode*); |
| 59 | 53 |
| 60 void SetFragment(NGPhysicalBoxFragment* fragment) { fragment_ = fragment; } | 54 void SetFragment(NGPhysicalBoxFragment* fragment) { fragment_ = fragment; } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 92 |
| 99 DEFINE_TYPE_CASTS(NGBlockNode, | 93 DEFINE_TYPE_CASTS(NGBlockNode, |
| 100 NGLayoutInputNode, | 94 NGLayoutInputNode, |
| 101 node, | 95 node, |
| 102 node->Type() == NGLayoutInputNode::kLegacyBlock, | 96 node->Type() == NGLayoutInputNode::kLegacyBlock, |
| 103 node.Type() == NGLayoutInputNode::kLegacyBlock); | 97 node.Type() == NGLayoutInputNode::kLegacyBlock); |
| 104 | 98 |
| 105 } // namespace blink | 99 } // namespace blink |
| 106 | 100 |
| 107 #endif // NGBlockNode | 101 #endif // NGBlockNode |
| OLD | NEW |