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

Unified Diff: Source/core/editing/SpellCheckRequester.cpp

Issue 23297002: Revert "Trigger spell check/remove markers if spell checker gets enabled/disabled." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | « Source/core/editing/SpellCheckRequester.h ('k') | Source/web/EditorClientImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/SpellCheckRequester.cpp
diff --git a/Source/core/editing/SpellCheckRequester.cpp b/Source/core/editing/SpellCheckRequester.cpp
index 4d34b8c7950049fc21dc33e748006c59f23ddc50..ad4509b9f538ced41b24c4a47dbaa7d6d862effe 100644
--- a/Source/core/editing/SpellCheckRequester.cpp
+++ b/Source/core/editing/SpellCheckRequester.cpp
@@ -46,14 +46,12 @@ SpellCheckRequest::SpellCheckRequest(
TextCheckingTypeMask mask,
TextCheckingProcessType processType,
const Vector<uint32_t>& documentMarkersInRange,
- const Vector<unsigned>& documentMarkerOffsets,
- int requestNumber)
+ const Vector<unsigned>& documentMarkerOffsets)
: m_requester(0)
, m_checkingRange(checkingRange)
, m_paragraphRange(paragraphRange)
, m_rootEditableElement(m_checkingRange->startContainer()->rootEditableElement())
, m_requestData(unrequestedTextCheckingSequence, text, mask, processType, documentMarkersInRange, documentMarkerOffsets)
- , m_requestNumber(requestNumber)
{
}
@@ -62,7 +60,7 @@ SpellCheckRequest::~SpellCheckRequest()
}
// static
-PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask textCheckingOptions, TextCheckingProcessType processType, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, int requestNubmer)
+PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask textCheckingOptions, TextCheckingProcessType processType, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange)
{
ASSERT(checkingRange);
ASSERT(paragraphRange);
@@ -79,7 +77,7 @@ PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex
offsets[i] = markers[i]->startOffset();
}
- return adoptRef(new SpellCheckRequest(checkingRange, paragraphRange, text, textCheckingOptions, processType, hashes, offsets, requestNubmer));
+ return adoptRef(new SpellCheckRequest(checkingRange, paragraphRange, text, textCheckingOptions, processType, hashes, offsets));
}
const TextCheckingRequestData& SpellCheckRequest::data() const
@@ -209,24 +207,13 @@ void SpellCheckRequester::invokeRequest(PassRefPtr<SpellCheckRequest> request)
void SpellCheckRequester::enqueueRequest(PassRefPtr<SpellCheckRequest> request)
{
ASSERT(request);
- bool continuation = false;
- if (!m_requestQueue.isEmpty()) {
- RefPtr<SpellCheckRequest> lastRequest = m_requestQueue.last();
- // It's a continuation if the number of the last request got incremented in the new one and
- // both apply to the same editable.
- continuation = request->rootEditableElement() == lastRequest->rootEditableElement()
- && request->requestNumber() == lastRequest->requestNumber() + 1;
- }
- // Spellcheck requests for chunks of text in the same element should not overwrite each other.
- if (!continuation) {
- for (RequestQueue::iterator it = m_requestQueue.begin(); it != m_requestQueue.end(); ++it) {
- if (request->rootEditableElement() != (*it)->rootEditableElement())
- continue;
+ for (RequestQueue::iterator it = m_requestQueue.begin(); it != m_requestQueue.end(); ++it) {
+ if (request->rootEditableElement() != (*it)->rootEditableElement())
+ continue;
- *it = request;
- return;
- }
+ *it = request;
+ return;
}
m_requestQueue.append(request);
« no previous file with comments | « Source/core/editing/SpellCheckRequester.h ('k') | Source/web/EditorClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698