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

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

Issue 2706353004: [LayoutNG] Introduce block child iterator. (Closed)
Patch Set: address comments. Created 3 years, 10 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 2017 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 NGBlockChildIterator_h
6 #define NGBlockChildIterator_h
7
8 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h"
10
11 namespace blink {
12
13 class NGLayoutInputNode;
14 class NGBreakToken;
15 class NGBlockBreakToken;
16
17 // A utility class for block-flow layout which given the first child and a
18 // break token will iterate through unfinished children.
19 //
20 // This class does not handle modifications to its arguments after it has been
21 // constructed.
22 class CORE_EXPORT NGBlockChildIterator {
23 public:
24 NGBlockChildIterator(NGLayoutInputNode* first_child,
25 NGBlockBreakToken* break_token);
26
27 // Returns the next input node which should be laid out, along with its
28 // respective break token.
29 std::pair<NGLayoutInputNode*, NGBreakToken*> NextChild();
Gleb Lanbin 2017/02/22 19:24:56 may be use a struct instead of std::pair ? NGBloc
ikilpatrick 2017/02/22 20:25:27 Done.
30
31 private:
32 Persistent<NGLayoutInputNode> child_;
33 Persistent<NGBlockBreakToken> break_token_;
34
35 // An index into break_token_'s ChildBreakTokens() vector. Used for keeping
36 // track of the next child break token to inspect.
37 size_t child_token_idx_;
38 };
39
40 } // namespace blink
41
42 #endif // NGBlockChildIterator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698