| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 TypingCommand::TextCompositionUpdate); | 578 TypingCommand::TextCompositionUpdate); |
| 579 // Event handlers might destroy document. | 579 // Event handlers might destroy document. |
| 580 if (!isAvailable()) | 580 if (!isAvailable()) |
| 581 return; | 581 return; |
| 582 | 582 |
| 583 // TODO(yosin): The use of updateStyleAndLayoutIgnorePendingStylesheets | 583 // TODO(yosin): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 584 // needs to be audited. see http://crbug.com/590369 for more details. | 584 // needs to be audited. see http://crbug.com/590369 for more details. |
| 585 document().updateStyleAndLayoutIgnorePendingStylesheets(); | 585 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 586 | 586 |
| 587 // Find out what node has the composition now. | 587 // Find out what node has the composition now. |
| 588 Position base = mostForwardCaretPosition(frame().selection().base()); | 588 Position base = mostForwardCaretPosition( |
| 589 frame().selection().computeVisibleSelectionInDOMTree().base()); |
| 589 Node* baseNode = base.anchorNode(); | 590 Node* baseNode = base.anchorNode(); |
| 590 if (!baseNode || !baseNode->isTextNode()) | 591 if (!baseNode || !baseNode->isTextNode()) |
| 591 return; | 592 return; |
| 592 | 593 |
| 593 Position extent = frame().selection().extent(); | 594 Position extent = frame().selection().extent(); |
| 594 Node* extentNode = extent.anchorNode(); | 595 Node* extentNode = extent.anchorNode(); |
| 595 | 596 |
| 596 unsigned extentOffset = extent.computeOffsetInContainerNode(); | 597 unsigned extentOffset = extent.computeOffsetInContainerNode(); |
| 597 unsigned baseOffset = base.computeOffsetInContainerNode(); | 598 unsigned baseOffset = base.computeOffsetInContainerNode(); |
| 598 | 599 |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 finishComposingText(DoNotKeepSelection); | 1120 finishComposingText(DoNotKeepSelection); |
| 1120 } | 1121 } |
| 1121 | 1122 |
| 1122 DEFINE_TRACE(InputMethodController) { | 1123 DEFINE_TRACE(InputMethodController) { |
| 1123 visitor->trace(m_frame); | 1124 visitor->trace(m_frame); |
| 1124 visitor->trace(m_compositionRange); | 1125 visitor->trace(m_compositionRange); |
| 1125 SynchronousMutationObserver::trace(visitor); | 1126 SynchronousMutationObserver::trace(visitor); |
| 1126 } | 1127 } |
| 1127 | 1128 |
| 1128 } // namespace blink | 1129 } // namespace blink |
| OLD | NEW |