Chromium Code Reviews| 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 bbd161bf33e0cc0389cf5a6d32762d8a1fefc3da..dee24b414adbe665f5adef145b5293df89a046ec 100644 |
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| @@ -255,7 +255,13 @@ bool InputMethodController::confirmCompositionOrInsertText(const String& text, C |
| return confirmComposition(composingText(), DoNotKeepSelection); |
| SelectionOffsetsScope selectionOffsetsScope(this); |
| - return confirmComposition(); |
| + bool result = confirmComposition(); |
| + |
| + // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| + // needs to be audited. see http://crbug.com/590369 for more details. |
| + frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
|
yosin_UTC9
2016/09/08 04:04:41
This is the first pattern which updates layout aft
Xiaocheng
2016/09/08 06:39:09
It is in fact the dtor of the SelectionOffsetsScop
|
| + |
| + return result; |
| } |
| void InputMethodController::cancelComposition() |
| @@ -354,6 +360,10 @@ void InputMethodController::setComposition(const String& text, const Vector<Comp |
| TypingCommand::deleteSelection(*frame().document(), TypingCommand::PreventSpellChecking); |
| } |
| + // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| + // needs to be audited. see http://crbug.com/590369 for more details. |
| + frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| + |
| setEditableSelectionOffsets(selectedRange); |
| return; |
| } |
| @@ -405,6 +415,10 @@ void InputMethodController::setComposition(const String& text, const Vector<Comp |
| if (baseNode->layoutObject()) |
| baseNode->layoutObject()->setShouldDoFullPaintInvalidation(); |
| + // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| + // needs to be audited. see http://crbug.com/590369 for more details. |
| + frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| + |
| // We shouldn't close typing in the middle of setComposition. |
| setEditableSelectionOffsets(selectedRange, NotUserTriggered); |
| @@ -498,9 +512,7 @@ bool InputMethodController::setSelectionOffsets(const PlainTextRange& selectionO |
| if (!rootEditableElement) |
| return false; |
| - // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets needs to be audited. |
| - // see http://crbug.com/590369 for more details. |
| - rootEditableElement->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| + DCHECK(!rootEditableElement->document().needsLayoutTreeUpdate()); |
| const EphemeralRange range = selectionOffsets.createRange(*rootEditableElement); |
| if (range.isNull()) |