Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 friend NGLayoutInputNode; | 27 friend NGLayoutInputNode; |
| 28 | 28 |
| 29 public: | 29 public: |
| 30 explicit NGBlockNode(LayoutObject*); | 30 explicit NGBlockNode(LayoutObject*); |
| 31 | 31 |
| 32 // TODO(layout-ng): make it private and declare a friend class to use in tests | 32 // TODO(layout-ng): make it private and declare a friend class to use in tests |
| 33 explicit NGBlockNode(ComputedStyle*); | 33 explicit NGBlockNode(ComputedStyle*); |
| 34 | 34 |
| 35 ~NGBlockNode() override; | 35 ~NGBlockNode() override; |
| 36 | 36 |
| 37 RefPtr<NGLayoutResult> Layout(NGConstraintSpace* constraint_space) override; | 37 RefPtr<NGLayoutResult> Layout(NGConstraintSpace* constraint_space, |
| 38 NGBreakToken* break_token = nullptr) override; | |
| 38 NGLayoutInputNode* NextSibling() override; | 39 NGLayoutInputNode* NextSibling() override; |
| 39 LayoutObject* GetLayoutObject() override; | 40 LayoutObject* GetLayoutObject() override; |
| 40 | 41 |
| 41 // Computes the value of min-content and max-content for this box. | 42 // Computes the value of min-content and max-content for this box. |
| 42 // If the underlying layout algorithm's ComputeMinAndMaxContentSizes returns | 43 // If the underlying layout algorithm's ComputeMinAndMaxContentSizes returns |
| 43 // no value, this function will synthesize these sizes using Layout with | 44 // no value, this function will synthesize these sizes using Layout with |
| 44 // special constraint spaces -- infinite available size for max content, zero | 45 // special constraint spaces -- infinite available size for max content, zero |
| 45 // available size for min content, and percentage resolution size zero for | 46 // available size for min content, and percentage resolution size zero for |
| 46 // both. | 47 // both. |
| 47 MinAndMaxContentSizes ComputeMinAndMaxContentSizes(); | 48 MinAndMaxContentSizes ComputeMinAndMaxContentSizes(); |
| 48 | 49 |
| 49 const ComputedStyle& Style() const; | 50 const ComputedStyle& Style() const; |
| 50 | 51 |
| 51 NGLayoutInputNode* FirstChild(); | 52 NGLayoutInputNode* FirstChild(); |
| 52 | 53 |
| 53 void SetNextSibling(NGLayoutInputNode*); | 54 void SetNextSibling(NGLayoutInputNode*); |
| 54 void SetFirstChild(NGLayoutInputNode*); | 55 void SetFirstChild(NGLayoutInputNode*); |
| 55 | 56 |
| 56 NGBreakToken* CurrentBreakToken() const; | 57 NGBreakToken* CurrentBreakToken() const; |
|
mstensho (USE GERRIT)
2017/02/27 13:44:36
Should remove this now, I guess.
ikilpatrick
2017/02/27 18:50:09
Done.
| |
| 57 bool IsLayoutFinished() const { | 58 bool IsLayoutFinished() const { |
|
mstensho (USE GERRIT)
2017/02/27 13:44:36
And this.
ikilpatrick
2017/02/27 18:50:09
Done.
| |
| 58 return layout_result_ && !layout_result_->PhysicalFragment()->BreakToken(); | 59 return layout_result_ && !layout_result_->PhysicalFragment()->BreakToken(); |
| 59 } | 60 } |
| 60 | 61 |
| 61 DECLARE_VIRTUAL_TRACE(); | 62 DECLARE_VIRTUAL_TRACE(); |
| 62 | 63 |
| 63 // Runs layout on layout_box_ and creates a fragment for the resulting | 64 // Runs layout on layout_box_ and creates a fragment for the resulting |
| 64 // geometry. | 65 // geometry. |
| 65 RefPtr<NGLayoutResult> RunOldLayout(const NGConstraintSpace&); | 66 RefPtr<NGLayoutResult> RunOldLayout(const NGConstraintSpace&); |
| 66 | 67 |
| 67 // Called if this is an out-of-flow block which needs to be | 68 // Called if this is an out-of-flow block which needs to be |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 93 | 94 |
| 94 DEFINE_TYPE_CASTS(NGBlockNode, | 95 DEFINE_TYPE_CASTS(NGBlockNode, |
| 95 NGLayoutInputNode, | 96 NGLayoutInputNode, |
| 96 node, | 97 node, |
| 97 node->Type() == NGLayoutInputNode::kLegacyBlock, | 98 node->Type() == NGLayoutInputNode::kLegacyBlock, |
| 98 node.Type() == NGLayoutInputNode::kLegacyBlock); | 99 node.Type() == NGLayoutInputNode::kLegacyBlock); |
| 99 | 100 |
| 100 } // namespace blink | 101 } // namespace blink |
| 101 | 102 |
| 102 #endif // NGBlockNode | 103 #endif // NGBlockNode |
| OLD | NEW |