Commit 3e22c3a8 authored by xiaochengh's avatar xiaochengh Committed by Commit bot

Add new RuntimeEnabledFeature: IdleTimeSpellChecking

As the first step of implementing Idle Time Spell Checker, this patch adds
a new runtime enabled feature IdleTimeSpellChecking, and exits the existing
spell-checking code paths when the feature is enabled.

BUG=671922

Review-Url: https://codereview.chromium.org/2566043003
Cr-Commit-Position: refs/heads/master@{#437840}
parent 5ba32e3b
......@@ -52,6 +52,7 @@
#include "core/loader/EmptyClients.h"
#include "core/page/Page.h"
#include "core/page/SpellCheckerClient.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/text/TextBreakIterator.h"
#include "platform/text/TextCheckerClient.h"
......@@ -187,6 +188,9 @@ void SpellChecker::toggleSpellCheckingEnabled() {
}
void SpellChecker::didBeginEditing(Element* element) {
if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
return;
if (!isSpellCheckingEnabled())
return;
......@@ -366,6 +370,9 @@ void SpellChecker::clearMisspellingsForMovingParagraphs(
void SpellChecker::markMisspellingsForMovingParagraphs(
const VisibleSelection& movingSelection) {
if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
return;
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
// In the long term we should use idle time spell checker to prevent
......@@ -398,6 +405,9 @@ void SpellChecker::markMisspellingsInternal(const VisibleSelection& selection) {
void SpellChecker::markMisspellingsAfterApplyingCommand(
const CompositeEditCommand& cmd) {
if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
return;
if (!isSpellCheckingEnabled())
return;
if (!isSpellCheckingEnabledFor(cmd.endingSelection()))
......@@ -868,6 +878,9 @@ static bool shouldCheckOldSelection(const Position& oldSelectionStart) {
void SpellChecker::respondToChangedSelection(
const Position& oldSelectionStart,
FrameSelection::SetSelectionOptions options) {
if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
return;
TRACE_EVENT0("blink", "SpellChecker::respondToChangedSelection");
if (!isSpellCheckingEnabledFor(oldSelectionStart))
return;
......@@ -924,6 +937,9 @@ void SpellChecker::removeSpellingMarkersUnderWords(
}
void SpellChecker::spellCheckAfterBlur() {
if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
return;
if (!frame().selection().selection().isContentEditable())
return;
......
......@@ -116,6 +116,7 @@ GeometryInterfaces status=experimental, implied_by=CompositorWorker
GetUserMedia status=stable
GlobalCacheStorage status=stable
IDBObserver status=experimental
IdleTimeSpellChecking
ImageCapture status=experimental, origin_trial_feature_name=ImageCapture
ImageOrientation status=test
IndexedDBExperimental status=experimental
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment