| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 // needs to be audited. see http://crbug.com/590369 for more details. | 583 // needs to be audited. see http://crbug.com/590369 for more details. |
| 584 document().updateStyleAndLayoutIgnorePendingStylesheets(); | 584 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 585 | 585 |
| 586 // Find out what node has the composition now. | 586 // Find out what node has the composition now. |
| 587 Position base = mostForwardCaretPosition( | 587 Position base = mostForwardCaretPosition( |
| 588 frame().selection().computeVisibleSelectionInDOMTree().base()); | 588 frame().selection().computeVisibleSelectionInDOMTree().base()); |
| 589 Node* baseNode = base.anchorNode(); | 589 Node* baseNode = base.anchorNode(); |
| 590 if (!baseNode || !baseNode->isTextNode()) | 590 if (!baseNode || !baseNode->isTextNode()) |
| 591 return; | 591 return; |
| 592 | 592 |
| 593 Position extent = frame().selection().extent(); | 593 Position extent = |
| 594 frame().selection().computeVisibleSelectionInDOMTree().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 |
| 599 m_hasComposition = true; | 600 m_hasComposition = true; |
| 600 if (!m_compositionRange) | 601 if (!m_compositionRange) |
| 601 m_compositionRange = Range::create(document()); | 602 m_compositionRange = Range::create(document()); |
| 602 m_compositionRange->setStart(baseNode, baseOffset); | 603 m_compositionRange->setStart(baseNode, baseOffset); |
| 603 m_compositionRange->setEnd(extentNode, extentOffset); | 604 m_compositionRange->setEnd(extentNode, extentOffset); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 finishComposingText(KeepSelection); | 1125 finishComposingText(KeepSelection); |
| 1125 } | 1126 } |
| 1126 | 1127 |
| 1127 DEFINE_TRACE(InputMethodController) { | 1128 DEFINE_TRACE(InputMethodController) { |
| 1128 visitor->trace(m_frame); | 1129 visitor->trace(m_frame); |
| 1129 visitor->trace(m_compositionRange); | 1130 visitor->trace(m_compositionRange); |
| 1130 SynchronousMutationObserver::trace(visitor); | 1131 SynchronousMutationObserver::trace(visitor); |
| 1131 } | 1132 } |
| 1132 | 1133 |
| 1133 } // namespace blink | 1134 } // namespace blink |
| OLD | NEW |