Index: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
index 5532d32b845d6a5547bde358e1e205171f647aaa..503eb2170925ba10af560c55af1c16c821867093 100644 |
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
@@ -494,7 +494,17 @@ void SpellChecker::markMisspellingsAfterTypingToWord( |
} |
bool SpellChecker::isSpellCheckingEnabledInFocusedNode() const { |
- Node* focusedNode = frame().selection().start().anchorNode(); |
+ // To avoid regression on speedometer benchmark[1] test, we should not |
+ // update layout tree in this code block. |
+ // [1] http://browserbench.org/Speedometer/ |
+ DocumentLifecycle::DisallowTransitionScope disallowTransition( |
+ frame().document()->lifecycle()); |
+ |
+ Node* focusedNode = frame() |
+ .selection() |
+ .selectionInDOMTree() |
+ .computeStartPosition() |
+ .anchorNode(); |
if (!focusedNode) |
return false; |
const Element* focusedElement = focusedNode->isElementNode() |