Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_box.h

Issue 2230683003: [LayoutNG] Initial implementation of NGBoxIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: synced to the head Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
8 #include "core/CoreExport.h" 9 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class ComputedStyle; 14 class ComputedStyle;
14 class LayoutObject; 15 class LayoutObject;
15 class NGConstraintSpace; 16 class NGConstraintSpace;
16 class NGFragment; 17 class NGFragment;
17 18
18 // Represents a node to be laid out. 19 // Represents a node to be laid out.
19 class CORE_EXPORT NGBox final { 20 class CORE_EXPORT NGBox final {
20 public: 21 public:
21 explicit NGBox(const LayoutObject* layoutObject) 22 explicit NGBox(const LayoutObject* layoutObject)
22 : m_layoutObject(layoutObject) {} 23 : m_layoutObject(layoutObject) {}
23 24
25 NGBoxIterator iterator() { return NGBoxIterator(m_layoutObject); }
24 operator bool() const { return m_layoutObject; } 26 operator bool() const { return m_layoutObject; }
25 27
26 NGFragment* layout(const NGConstraintSpace&); 28 NGFragment* layout(const NGConstraintSpace&);
27 const ComputedStyle* style() const; 29 const ComputedStyle* style() const;
28 30
29 // TODO(layout-ng): Returning a children iterator would be better here.
30 const NGBox firstChild() const;
31 const NGBox nextSibling() const;
32
33 private: 31 private:
34 const LayoutObject* m_layoutObject; 32 const LayoutObject* m_layoutObject;
35 }; 33 };
36 34
37 } // namespace blink 35 } // namespace blink
38 36
39 #endif // NGBox_h 37 #endif // NGBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698