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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 frame().chromeClient().didCancelCompositionOnSelectionChange(); | 239 frame().chromeClient().didCancelCompositionOnSelectionChange(); |
240 } | 240 } |
241 | 241 |
242 void InputMethodController::setComposition(const String& text, const Vector<Comp
ositionUnderline>& underlines, int selectionStart, int selectionEnd) | 242 void InputMethodController::setComposition(const String& text, const Vector<Comp
ositionUnderline>& underlines, int selectionStart, int selectionEnd) |
243 { | 243 { |
244 Editor::RevealSelectionScope revealSelectionScope(&editor()); | 244 Editor::RevealSelectionScope revealSelectionScope(&editor()); |
245 | 245 |
246 // Updates styles before setting selection for composition to prevent | 246 // Updates styles before setting selection for composition to prevent |
247 // inserting the previous composition text into text nodes oddly. | 247 // inserting the previous composition text into text nodes oddly. |
248 // See https://bugs.webkit.org/show_bug.cgi?id=46868 | 248 // See https://bugs.webkit.org/show_bug.cgi?id=46868 |
249 frame().document()->updateLayoutTree(); | 249 frame().document()->updateStyleAndLayoutTree(); |
250 | 250 |
251 selectComposition(); | 251 selectComposition(); |
252 | 252 |
253 if (frame().selection().isNone()) | 253 if (frame().selection().isNone()) |
254 return; | 254 return; |
255 | 255 |
256 if (Element* target = frame().document()->focusedElement()) { | 256 if (Element* target = frame().document()->focusedElement()) { |
257 // Dispatch an appropriate composition event to the focused node. | 257 // Dispatch an appropriate composition event to the focused node. |
258 // We check the composition status and choose an appropriate composition
event since this | 258 // We check the composition status and choose an appropriate composition
event since this |
259 // function is used for three purposes: | 259 // function is used for three purposes: |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 TypingCommand::deleteSelection(*frame().document()); | 489 TypingCommand::deleteSelection(*frame().document()); |
490 } | 490 } |
491 | 491 |
492 DEFINE_TRACE(InputMethodController) | 492 DEFINE_TRACE(InputMethodController) |
493 { | 493 { |
494 visitor->trace(m_frame); | 494 visitor->trace(m_frame); |
495 visitor->trace(m_compositionRange); | 495 visitor->trace(m_compositionRange); |
496 } | 496 } |
497 | 497 |
498 } // namespace blink | 498 } // namespace blink |
OLD | NEW |