| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_layout_inline_items_builder.h" | 5 #include "core/layout/ng/ng_layout_inline_items_builder.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutObject.h" | 7 #include "core/layout/LayoutObject.h" |
| 8 #include "core/layout/ng/ng_inline_node.h" | 8 #include "core/layout/ng/ng_inline_node.h" |
| 9 #include "core/style/ComputedStyle.h" | 9 #include "core/style/ComputedStyle.h" |
| 10 | 10 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 // Adjust the last item if the removed space is already appended. | 249 // Adjust the last item if the removed space is already appended. |
| 250 for (unsigned i = items_->size(); i > 0;) { | 250 for (unsigned i = items_->size(); i > 0;) { |
| 251 NGLayoutInlineItem& item = (*items_)[--i]; | 251 NGLayoutInlineItem& item = (*items_)[--i]; |
| 252 DCHECK_EQ(item.EndOffset(), new_size + 1); | 252 DCHECK_EQ(item.EndOffset(), new_size + 1); |
| 253 if (item.Type() == NGLayoutInlineItem::kText) { | 253 if (item.Type() == NGLayoutInlineItem::kText) { |
| 254 DCHECK_GE(item.Length(), 1u); | 254 DCHECK_GE(item.Length(), 1u); |
| 255 if (item.Length() > 1) | 255 if (item.Length() > 1) |
| 256 item.SetEndOffset(new_size); | 256 item.SetEndOffset(new_size); |
| 257 else | 257 else |
| 258 items_->remove(i); | 258 items_->erase(i); |
| 259 break; | 259 break; |
| 260 } | 260 } |
| 261 if (!item.Length()) { | 261 if (!item.Length()) { |
| 262 // Trailing spaces can be removed across non-character items. | 262 // Trailing spaces can be removed across non-character items. |
| 263 item.SetOffset(new_size, new_size); | 263 item.SetOffset(new_size, new_size); |
| 264 continue; | 264 continue; |
| 265 } | 265 } |
| 266 NOTREACHED(); | 266 NOTREACHED(); |
| 267 break; | 267 break; |
| 268 } | 268 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 void NGLayoutInlineItemsBuilder::Exit(LayoutObject* node) { | 360 void NGLayoutInlineItemsBuilder::Exit(LayoutObject* node) { |
| 361 while (!exits_.isEmpty() && exits_.back().node == node) { | 361 while (!exits_.isEmpty() && exits_.back().node == node) { |
| 362 Append(NGLayoutInlineItem::kBidiControl, exits_.back().character); | 362 Append(NGLayoutInlineItem::kBidiControl, exits_.back().character); |
| 363 exits_.pop_back(); | 363 exits_.pop_back(); |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace blink | 367 } // namespace blink |
| OLD | NEW |