Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2644623003: Revert 'Make "compositionend" event fired after setting caret position' (Closed)
Patch Set: Add updateStyleAndLayoutIgnorePendingStylesheets Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index 1b11d96ae61cb76ff1d74a0a80537ee9d18c8bf5..50c4d95d121410f20ccfe36e4d0942ff890e6f28 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -251,18 +251,13 @@ bool InputMethodController::finishComposingText(
PlainTextRange oldOffsets = getSelectionOffsets();
Editor::RevealSelectionScope revealSelectionScope(&editor());
- const String& composing = composingText();
- const bool result = replaceComposition(composing);
+ bool result = replaceComposition(composingText());
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. see http://crbug.com/590369 for more details.
document().updateStyleAndLayoutIgnorePendingStylesheets();
setSelectionOffsets(oldOffsets);
-
- // No DOM update after 'compositionend'.
- dispatchCompositionEndEvent(frame(), composing);
-
return result;
}
@@ -317,6 +312,9 @@ bool InputMethodController::replaceComposition(const String& text) {
if (!isAvailable())
return false;
+ // No DOM update after 'compositionend'.
+ dispatchCompositionEndEvent(frame(), text);
+
return true;
}
@@ -364,17 +362,15 @@ bool InputMethodController::replaceCompositionAndMoveCaret(
if (!replaceComposition(text))
return false;
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. see http://crbug.com/590369 for more details.
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
addCompositionUnderlines(underlines, rootEditableElement, textStart);
int absoluteCaretPosition = computeAbsoluteCaretPosition(
textStart, text.length(), relativeCaretPosition);
- if (!moveCaret(absoluteCaretPosition))
- return false;
-
- // No DOM update after 'compositionend'.
- dispatchCompositionEndEvent(frame(), text);
-
- return true;
+ return moveCaret(absoluteCaretPosition);
}
bool InputMethodController::insertText(const String& text) {
@@ -543,9 +539,7 @@ void InputMethodController::setComposition(
document().updateStyleAndLayoutIgnorePendingStylesheets();
setEditableSelectionOffsets(selectedRange);
-
- // No DOM update after 'compositionend'.
- return dispatchCompositionEndEvent(frame(), text);
+ return;
}
// We should send a 'compositionstart' event only when the given text is not
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698