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 NGBox_h | 5 #ifndef NGBox_h |
6 #define NGBox_h | 6 #define NGBox_h |
7 | 7 |
8 #include "core/layout/ng/ng_box_iterator.h" | |
9 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
10 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
11 | 10 |
12 namespace blink { | 11 namespace blink { |
13 | 12 |
14 class ComputedStyle; | 13 class ComputedStyle; |
15 class LayoutObject; | 14 class LayoutObject; |
16 class NGConstraintSpace; | 15 class NGConstraintSpace; |
17 class NGFragment; | 16 class NGFragment; |
18 | 17 |
19 // Represents a node to be laid out. | 18 // Represents a node to be laid out. |
20 class CORE_EXPORT NGBox final { | 19 class CORE_EXPORT NGBox final { |
21 public: | 20 public: |
22 explicit NGBox(const LayoutObject* layoutObject) | 21 explicit NGBox(const LayoutObject* layoutObject) |
23 : m_layoutObject(layoutObject) {} | 22 : m_layoutObject(layoutObject) {} |
24 | 23 |
25 NGBoxIterator iterator() { return NGBoxIterator(m_layoutObject); } | |
26 operator bool() const { return m_layoutObject; } | 24 operator bool() const { return m_layoutObject; } |
27 | 25 |
28 NGFragment* layout(const NGConstraintSpace&); | 26 NGFragment* layout(const NGConstraintSpace&); |
29 const ComputedStyle* style() const; | 27 const ComputedStyle* style() const; |
30 | 28 |
| 29 // TODO(layout-ng): Returning a children iterator would be better here. |
| 30 const NGBox firstChild() const; |
| 31 const NGBox nextSibling() const; |
| 32 |
31 private: | 33 private: |
32 const LayoutObject* m_layoutObject; | 34 const LayoutObject* m_layoutObject; |
33 }; | 35 }; |
34 | 36 |
35 } // namespace blink | 37 } // namespace blink |
36 | 38 |
37 #endif // NGBox_h | 39 #endif // NGBox_h |
OLD | NEW |