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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 return EphemeralRange(Position(m_compositionNode.get(), start), Position(m_c ompositionNode.get(), end)); | 352 return EphemeralRange(Position(m_compositionNode.get(), start), Position(m_c ompositionNode.get(), end)); |
353 } | 353 } |
354 | 354 |
355 PassRefPtrWillBeRawPtr<Range> InputMethodController::compositionRange() const | 355 PassRefPtrWillBeRawPtr<Range> InputMethodController::compositionRange() const |
356 { | 356 { |
357 return createRange(compositionEphemeralRange()); | 357 return createRange(compositionEphemeralRange()); |
358 } | 358 } |
359 | 359 |
360 PlainTextRange InputMethodController::getSelectionOffsets() const | 360 PlainTextRange InputMethodController::getSelectionOffsets() const |
361 { | 361 { |
362 RefPtrWillBeRawPtr<Range> range = firstRangeOf(frame().selection().selection ()); | 362 EphemeralRange range = firstEphemeralRangeOf(frame().selection().selection() ); |
yosin_UTC9
2015/09/10 06:37:03
nit: |const EphmeralRange|
| |
363 if (!range) | 363 if (range.isNull()) |
364 return PlainTextRange(); | 364 return PlainTextRange(); |
365 ContainerNode* editable = frame().selection().rootEditableElementOrTreeScope RootNode(); | 365 ContainerNode* editable = frame().selection().rootEditableElementOrTreeScope RootNode(); |
366 ASSERT(editable); | 366 ASSERT(editable); |
367 return PlainTextRange::create(*editable, *range.get()); | 367 return PlainTextRange::create(*editable, range); |
368 } | 368 } |
369 | 369 |
370 bool InputMethodController::setSelectionOffsets(const PlainTextRange& selectionO ffsets) | 370 bool InputMethodController::setSelectionOffsets(const PlainTextRange& selectionO ffsets) |
371 { | 371 { |
372 if (selectionOffsets.isNull()) | 372 if (selectionOffsets.isNull()) |
373 return false; | 373 return false; |
374 Element* rootEditableElement = frame().selection().rootEditableElement(); | 374 Element* rootEditableElement = frame().selection().rootEditableElement(); |
375 if (!rootEditableElement) | 375 if (!rootEditableElement) |
376 return false; | 376 return false; |
377 | 377 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 TypingCommand::deleteSelection(*frame().document()); | 419 TypingCommand::deleteSelection(*frame().document()); |
420 } | 420 } |
421 | 421 |
422 DEFINE_TRACE(InputMethodController) | 422 DEFINE_TRACE(InputMethodController) |
423 { | 423 { |
424 visitor->trace(m_frame); | 424 visitor->trace(m_frame); |
425 visitor->trace(m_compositionNode); | 425 visitor->trace(m_compositionNode); |
426 } | 426 } |
427 | 427 |
428 } // namespace blink | 428 } // namespace blink |
OLD | NEW |