OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #include "core/layout/ng/ng_block_child_iterator.h" | 5 #include "core/layout/ng/ng_block_child_iterator.h" |
6 | 6 |
7 #include "core/layout/ng/ng_block_break_token.h" | 7 #include "core/layout/ng/ng_block_break_token.h" |
8 #include "core/layout/ng/ng_layout_input_node.h" | 8 #include "core/layout/ng/ng_layout_input_node.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 16 matching lines...) Expand all Loading... |
27 const auto& child_break_tokens = break_token_->ChildBreakTokens(); | 27 const auto& child_break_tokens = break_token_->ChildBreakTokens(); |
28 | 28 |
29 do { | 29 do { |
30 // Early exit if we've exhausted our child break tokens. | 30 // Early exit if we've exhausted our child break tokens. |
31 if (child_token_idx_ >= child_break_tokens.size()) | 31 if (child_token_idx_ >= child_break_tokens.size()) |
32 break; | 32 break; |
33 | 33 |
34 // This child break token candidate doesn't match the current node, this | 34 // This child break token candidate doesn't match the current node, this |
35 // node must be unfinished. | 35 // node must be unfinished. |
36 NGBreakToken* child_break_token_candidate = | 36 NGBreakToken* child_break_token_candidate = |
37 child_break_tokens[child_token_idx_]; | 37 child_break_tokens[child_token_idx_].get(); |
38 if (child_break_token_candidate->InputNode() != child_) | 38 if (child_break_token_candidate->InputNode() != child_) |
39 break; | 39 break; |
40 | 40 |
41 ++child_token_idx_; | 41 ++child_token_idx_; |
42 | 42 |
43 // We have only found a node if its break token is unfinished. | 43 // We have only found a node if its break token is unfinished. |
44 if (!child_break_token_candidate->IsFinished()) { | 44 if (!child_break_token_candidate->IsFinished()) { |
45 child_break_token = child_break_token_candidate; | 45 child_break_token = child_break_token_candidate; |
46 break; | 46 break; |
47 } | 47 } |
48 } while ((child_ = child_->NextSibling())); | 48 } while ((child_ = child_->NextSibling())); |
49 } | 49 } |
50 | 50 |
51 NGLayoutInputNode* child = child_; | 51 NGLayoutInputNode* child = child_; |
52 if (child_) | 52 if (child_) |
53 child_ = child_->NextSibling(); | 53 child_ = child_->NextSibling(); |
54 | 54 |
55 return Entry(child, child_break_token); | 55 return Entry(child, child_break_token); |
56 } | 56 } |
57 | 57 |
58 } // namespace blink | 58 } // namespace blink |
OLD | NEW |