| 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 NGBlockLayoutAlgorithm_h | 5 #ifndef NGBlockLayoutAlgorithm_h |
| 6 #define NGBlockLayoutAlgorithm_h | 6 #define NGBlockLayoutAlgorithm_h |
| 7 | 7 |
| 8 #include "wtf/RefPtr.h" |
| 9 |
| 8 namespace blink { | 10 namespace blink { |
| 9 | 11 |
| 12 class ComputedStyle; |
| 13 class LayoutBox; |
| 14 class NGConstraintSpace; |
| 15 class NGFragment; |
| 16 |
| 17 // A class for general block layout (e.g. a <div> with no special style). |
| 18 // Lays out the children in sequence. |
| 10 class NGBlockLayoutAlgorithm { | 19 class NGBlockLayoutAlgorithm { |
| 11 public: | 20 public: |
| 12 NGBlockLayoutAlgorithm(); | 21 NGBlockLayoutAlgorithm(const ComputedStyle*); |
| 22 |
| 23 // Actual layout implementation. Lays out the children in sequence within |
| 24 // the constraints given by the NGConstraintSpace. Returns a fragment |
| 25 // with the resulting layout information. |
| 26 // This function can not be const because for interruptible layout, we have |
| 27 // to be able to store state information. |
| 28 NGFragment* layout(const NGConstraintSpace&); |
| 29 private: |
| 30 RefPtr<const ComputedStyle> m_style; |
| 13 }; | 31 }; |
| 14 | 32 |
| 15 } // namespace blink | 33 } // namespace blink |
| 16 | 34 |
| 17 #endif // NGBlockLayoutAlgorithm_h | 35 #endif // NGBlockLayoutAlgorithm_h |
| OLD | NEW |