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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2698793003: Get rid of redundant layout tree update related to selection (Closed)
Patch Set: 2017-02-17T16:13:56 selectionTypeWithLegacyGranularity() Created 3 years, 10 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
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()

Powered by Google App Engine
This is Rietveld 408576698