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

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

Issue 2237623002: Demo patch that demonstrates simple block layout using Layout NG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NGBoxIterator_h
6 #define NGBoxIterator_h
7
8 #include "core/layout/LayoutObject.h"
9
10 namespace blink {
11
12 class NGBox;
13
14 // NG Box iterator over siblings of the layout object.
15 class NGBoxIterator : public std::iterator<std::forward_iterator_tag, NGBox> {
16 public:
17 class iterator {
18 public:
19 iterator& operator=(const iterator& otherValue);
20 iterator(LayoutObject* layoutObject) : m_layoutObject(layoutObject) {}
21 iterator& operator++();
22 bool operator!=(const iterator& other);
23 NGBox operator*();
24
25 private:
26 LayoutObject* m_layoutObject;
27 };
28 explicit NGBoxIterator(LayoutObject*);
29
30 iterator begin() const { return iterator(m_layoutObject->slowFirstChild()); }
31 iterator end() const { return iterator(nullptr); }
32
33 private:
34 LayoutObject* m_layoutObject;
35 };
36
37 } // namespace blink
38 #endif // NGBoxIterator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698