OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 { | 342 { |
343 Element* editable = frame().selection().rootEditableElement(); | 343 Element* editable = frame().selection().rootEditableElement(); |
344 if (!editable) | 344 if (!editable) |
345 return; | 345 return; |
346 | 346 |
347 const EphemeralRange range = PlainTextRange(compositionStart, compositionEnd
).createRange(*editable); | 347 const EphemeralRange range = PlainTextRange(compositionStart, compositionEnd
).createRange(*editable); |
348 if (range.isNull()) | 348 if (range.isNull()) |
349 return; | 349 return; |
350 | 350 |
351 const Position start = range.startPosition(); | 351 const Position start = range.startPosition(); |
352 if (editableRootElementForPosition(start) != editable) | 352 if (rootEditableElementOf(start) != editable) |
353 return; | 353 return; |
354 | 354 |
355 const Position end = range.endPosition(); | 355 const Position end = range.endPosition(); |
356 if (editableRootElementForPosition(end) != editable) | 356 if (rootEditableElementOf(end) != editable) |
357 return; | 357 return; |
358 | 358 |
359 clear(); | 359 clear(); |
360 | 360 |
361 for (const auto& underline : underlines) { | 361 for (const auto& underline : underlines) { |
362 unsigned underlineStart = compositionStart + underline.startOffset; | 362 unsigned underlineStart = compositionStart + underline.startOffset; |
363 unsigned underlineEnd = compositionStart + underline.endOffset; | 363 unsigned underlineEnd = compositionStart + underline.endOffset; |
364 EphemeralRange ephemeralLineRange = PlainTextRange(underlineStart, under
lineEnd).createRange(*editable); | 364 EphemeralRange ephemeralLineRange = PlainTextRange(underlineStart, under
lineEnd).createRange(*editable); |
365 if (ephemeralLineRange.isNull()) | 365 if (ephemeralLineRange.isNull()) |
366 continue; | 366 continue; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 TypingCommand::deleteSelection(*frame().document()); | 453 TypingCommand::deleteSelection(*frame().document()); |
454 } | 454 } |
455 | 455 |
456 DEFINE_TRACE(InputMethodController) | 456 DEFINE_TRACE(InputMethodController) |
457 { | 457 { |
458 visitor->trace(m_frame); | 458 visitor->trace(m_frame); |
459 visitor->trace(m_compositionRange); | 459 visitor->trace(m_compositionRange); |
460 } | 460 } |
461 | 461 |
462 } // namespace blink | 462 } // namespace blink |
OLD | NEW |