| 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 NGInlineLayoutAlgorithm_h | 5 #ifndef NGInlineLayoutAlgorithm_h |
| 6 #define NGInlineLayoutAlgorithm_h | 6 #define NGInlineLayoutAlgorithm_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_layout_algorithm.h" | 9 #include "core/layout/ng/ng_layout_algorithm.h" |
| 10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // @param style Style reference of the block that is being laid out. | 30 // @param style Style reference of the block that is being laid out. |
| 31 // @param first_child Our first child; the algorithm will use its NextSibling | 31 // @param first_child Our first child; the algorithm will use its NextSibling |
| 32 // method to access all the children. | 32 // method to access all the children. |
| 33 // @param space The constraint space which the algorithm should generate a | 33 // @param space The constraint space which the algorithm should generate a |
| 34 // fragment within. | 34 // fragment within. |
| 35 NGInlineLayoutAlgorithm(PassRefPtr<const ComputedStyle>, | 35 NGInlineLayoutAlgorithm(PassRefPtr<const ComputedStyle>, |
| 36 NGInlineNode* first_child, | 36 NGInlineNode* first_child, |
| 37 NGConstraintSpace* space, | 37 NGConstraintSpace* space, |
| 38 NGBreakToken* break_token = nullptr); | 38 NGBreakToken* break_token = nullptr); |
| 39 | 39 |
| 40 NGLayoutStatus Layout(NGPhysicalFragmentBase*, | 40 NGLayoutStatus Layout(NGPhysicalFragment*, |
| 41 NGPhysicalFragmentBase**, | 41 NGPhysicalFragment**, |
| 42 NGLayoutAlgorithm**) override; | 42 NGLayoutAlgorithm**) override; |
| 43 | 43 |
| 44 DECLARE_VIRTUAL_TRACE(); | 44 DECLARE_VIRTUAL_TRACE(); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Read-only Getters. | 47 // Read-only Getters. |
| 48 const ComputedStyle& Style() const { return *style_; } | 48 const ComputedStyle& Style() const { return *style_; } |
| 49 | 49 |
| 50 bool LayoutCurrentChild(); | 50 bool LayoutCurrentChild(); |
| 51 NGConstraintSpace* CreateConstraintSpaceForCurrentChild() const; | 51 NGConstraintSpace* CreateConstraintSpaceForCurrentChild() const; |
| 52 | 52 |
| 53 enum State { kStateInit, kStateChildLayout, kStateFinalize }; | 53 enum State { kStateInit, kStateChildLayout, kStateFinalize }; |
| 54 State state_ = kStateInit; | 54 State state_ = kStateInit; |
| 55 | 55 |
| 56 RefPtr<const ComputedStyle> style_; | 56 RefPtr<const ComputedStyle> style_; |
| 57 Member<NGInlineNode> first_child_; | 57 Member<NGInlineNode> first_child_; |
| 58 Member<NGConstraintSpace> constraint_space_; | 58 Member<NGConstraintSpace> constraint_space_; |
| 59 Member<NGBreakToken> break_token_; | 59 Member<NGBreakToken> break_token_; |
| 60 Member<NGFragmentBuilder> builder_; | 60 Member<NGFragmentBuilder> builder_; |
| 61 Member<NGConstraintSpace> space_for_current_child_; | 61 Member<NGConstraintSpace> space_for_current_child_; |
| 62 Member<NGInlineNode> current_child_; | 62 Member<NGInlineNode> current_child_; |
| 63 Member<NGLineBuilder> line_builder_; | 63 Member<NGLineBuilder> line_builder_; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| 67 | 67 |
| 68 #endif // NGInlineLayoutAlgorithm_h | 68 #endif // NGInlineLayoutAlgorithm_h |
| OLD | NEW |