Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/ng/ng_block_child_iterator.h |
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_child_iterator.h b/third_party/WebKit/Source/core/layout/ng/ng_block_child_iterator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..77824d58dafe414ecbba6154c1fa904730ab7cea |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_child_iterator.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef NGBlockChildIterator_h |
| +#define NGBlockChildIterator_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class NGLayoutInputNode; |
| +class NGBreakToken; |
| +class NGBlockBreakToken; |
| + |
| +// A utility class for block-flow layout which given the first child and a |
| +// break token will iterate through unfinished children. |
| +// |
| +// This class does not handle modifications to its arguments after it has been |
| +// constructed. |
| +class CORE_EXPORT NGBlockChildIterator { |
| + public: |
| + NGBlockChildIterator(NGLayoutInputNode* first_child, |
| + NGBlockBreakToken* break_token); |
| + |
| + // Returns the next input node which should be laid out, along with its |
| + // respective break token. |
| + 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.
|
| + |
| + private: |
| + Persistent<NGLayoutInputNode> child_; |
| + Persistent<NGBlockBreakToken> break_token_; |
| + |
| + // An index into break_token_'s ChildBreakTokens() vector. Used for keeping |
| + // track of the next child break token to inspect. |
| + size_t child_token_idx_; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // NGBlockChildIterator_h |