OLD | NEW |
---|---|
(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 | |
OLD | NEW |