| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return PositionTemplate<Strategy>(); | 316 return PositionTemplate<Strategy>(); |
| 317 | 317 |
| 318 const PositionTemplate<Strategy> start = | 318 const PositionTemplate<Strategy> start = |
| 319 PositionTemplate<Strategy>::EditingPositionOf(boundary, 0) | 319 PositionTemplate<Strategy>::EditingPositionOf(boundary, 0) |
| 320 .ParentAnchoredEquivalent(); | 320 .ParentAnchoredEquivalent(); |
| 321 const PositionTemplate<Strategy> end = pos.ParentAnchoredEquivalent(); | 321 const PositionTemplate<Strategy> end = pos.ParentAnchoredEquivalent(); |
| 322 | 322 |
| 323 ForwardsTextBuffer suffix_string; | 323 ForwardsTextBuffer suffix_string; |
| 324 if (RequiresContextForWordBoundary(CharacterBefore(c))) { | 324 if (RequiresContextForWordBoundary(CharacterBefore(c))) { |
| 325 TextIteratorAlgorithm<Strategy> forwards_iterator( | 325 TextIteratorAlgorithm<Strategy> forwards_iterator( |
| 326 end, PositionTemplate<Strategy>::AfterNode(boundary)); | 326 end, PositionTemplate<Strategy>::AfterNode(*boundary)); |
| 327 while (!forwards_iterator.AtEnd()) { | 327 while (!forwards_iterator.AtEnd()) { |
| 328 forwards_iterator.CopyTextTo(&suffix_string); | 328 forwards_iterator.CopyTextTo(&suffix_string); |
| 329 int context_end_index = EndOfFirstWordBoundaryContext( | 329 int context_end_index = EndOfFirstWordBoundaryContext( |
| 330 suffix_string.Data() + suffix_string.Size() - | 330 suffix_string.Data() + suffix_string.Size() - |
| 331 forwards_iterator.length(), | 331 forwards_iterator.length(), |
| 332 forwards_iterator.length()); | 332 forwards_iterator.length()); |
| 333 if (context_end_index < forwards_iterator.length()) { | 333 if (context_end_index < forwards_iterator.length()) { |
| 334 suffix_string.Shrink(forwards_iterator.length() - context_end_index); | 334 suffix_string.Shrink(forwards_iterator.length() - context_end_index); |
| 335 break; | 335 break; |
| 336 } | 336 } |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 // we terminate early to avoid doing a nodeIndex() call. | 1379 // we terminate early to avoid doing a nodeIndex() call. |
| 1380 if (EndsOfNodeAreVisuallyDistinctPositions(current_node) && | 1380 if (EndsOfNodeAreVisuallyDistinctPositions(current_node) && |
| 1381 current_pos.AtStartOfNode()) | 1381 current_pos.AtStartOfNode()) |
| 1382 return last_visible.DeprecatedComputePosition(); | 1382 return last_visible.DeprecatedComputePosition(); |
| 1383 | 1383 |
| 1384 // Return position after tables and nodes which have content that can be | 1384 // Return position after tables and nodes which have content that can be |
| 1385 // ignored. | 1385 // ignored. |
| 1386 if (EditingIgnoresContent(*current_node) || | 1386 if (EditingIgnoresContent(*current_node) || |
| 1387 IsDisplayInsideTable(current_node)) { | 1387 IsDisplayInsideTable(current_node)) { |
| 1388 if (current_pos.AtEndOfNode()) | 1388 if (current_pos.AtEndOfNode()) |
| 1389 return PositionTemplate<Strategy>::AfterNode(current_node); | 1389 return PositionTemplate<Strategy>::AfterNode(*current_node); |
| 1390 continue; | 1390 continue; |
| 1391 } | 1391 } |
| 1392 | 1392 |
| 1393 // return current position if it is in laid out text | 1393 // return current position if it is in laid out text |
| 1394 if (!layout_object->IsText()) | 1394 if (!layout_object->IsText()) |
| 1395 continue; | 1395 continue; |
| 1396 LayoutText* const text_layout_object = ToLayoutText(layout_object); | 1396 LayoutText* const text_layout_object = ToLayoutText(layout_object); |
| 1397 if (!text_layout_object->FirstTextBox()) | 1397 if (!text_layout_object->FirstTextBox()) |
| 1398 continue; | 1398 continue; |
| 1399 const unsigned text_start_offset = text_layout_object->TextStartOffset(); | 1399 const unsigned text_start_offset = text_layout_object->TextStartOffset(); |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 | 2075 |
| 2076 IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) { | 2076 IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) { |
| 2077 return EnclosingIntRect(ComputeTextRectTemplate(range)); | 2077 return EnclosingIntRect(ComputeTextRectTemplate(range)); |
| 2078 } | 2078 } |
| 2079 | 2079 |
| 2080 FloatRect ComputeTextFloatRect(const EphemeralRange& range) { | 2080 FloatRect ComputeTextFloatRect(const EphemeralRange& range) { |
| 2081 return ComputeTextRectTemplate(range); | 2081 return ComputeTextRectTemplate(range); |
| 2082 } | 2082 } |
| 2083 | 2083 |
| 2084 } // namespace blink | 2084 } // namespace blink |
| OLD | NEW |