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 "core/layout/ng/ng_box.h" | 8 #include "core/layout/ng/ng_box.h" |
9 #include "core/layout/ng/ng_box_iterator.h" | |
9 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class ComputedStyle; | 14 class ComputedStyle; |
14 class NGConstraintSpace; | 15 class NGConstraintSpace; |
15 class NGFragment; | 16 class NGFragment; |
16 | 17 |
17 // A class for general block layout (e.g. a <div> with no special style). | 18 // A class for general block layout (e.g. a <div> with no special style). |
18 // Lays out the children in sequence. | 19 // Lays out the children in sequence. |
19 class NGBlockLayoutAlgorithm { | 20 class NGBlockLayoutAlgorithm { |
20 public: | 21 public: |
21 NGBlockLayoutAlgorithm(PassRefPtr<const ComputedStyle>, NGBox); | 22 NGBlockLayoutAlgorithm(PassRefPtr<const ComputedStyle>, NGBoxIterator); |
cbiesinger
2016/08/10 19:55:24
Can you add a comment saying that the iterator is
Gleb Lanbin
2016/08/10 20:11:44
Done.
| |
22 | 23 |
23 // Actual layout implementation. Lays out the children in sequence within the | 24 // Actual layout implementation. Lays out the children in sequence within the |
24 // constraints given by the NGConstraintSpace. Returns a fragment with the | 25 // constraints given by the NGConstraintSpace. Returns a fragment with the |
25 // resulting layout information. | 26 // resulting layout information. |
26 // This function can not be const because for interruptible layout, we have | 27 // This function can not be const because for interruptible layout, we have |
27 // to be able to store state information. | 28 // to be able to store state information. |
28 NGFragment* layout(const NGConstraintSpace&); | 29 NGFragment* layout(const NGConstraintSpace&); |
29 | 30 |
30 private: | 31 private: |
31 RefPtr<const ComputedStyle> m_style; | 32 RefPtr<const ComputedStyle> m_style; |
32 NGBox m_firstChild; | 33 NGBoxIterator m_ngBoxIterator; |
cbiesinger
2016/08/10 19:55:24
I'd rather us not put the "ng" in the variable nam
eae
2016/08/10 19:59:32
agreed. boxIterator will do.
Gleb Lanbin
2016/08/10 20:11:44
Done.
| |
33 }; | 34 }; |
34 | 35 |
35 } // namespace blink | 36 } // namespace blink |
36 | 37 |
37 #endif // NGBlockLayoutAlgorithm_h | 38 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |