Clean up spellcheck state when changing focus.

https://bugs.webkit.org/show_bug.cgi?id=114758

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-04-17
Reviewed by Rob Buis.

Internally reviewed by Mike Fenton and Gen Mak.

PR325941
If we lose focus while waiting for a spellcheck request to return, we will
never see the reply and continue to queue up future requests. By clearing
the queue we ensure that all requests being processed and waiting to fire
are valid.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::setElementUnfocused):
* WebKitSupport/SpellingHandler.cpp:
(BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 871190d5
2013-04-17 Nima Ghanavatian <nghanavatian@blackberry.com>
Clean up spellcheck state when changing focus.
https://bugs.webkit.org/show_bug.cgi?id=114758
Reviewed by Rob Buis.
Internally reviewed by Mike Fenton and Gen Mak.
PR325941
If we lose focus while waiting for a spellcheck request to return, we will
never see the reply and continue to queue up future requests. By clearing
the queue we ensure that all requests being processed and waiting to fire
are valid.
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::setElementUnfocused):
* WebKitSupport/SpellingHandler.cpp:
(BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
2013-04-17 Tiancheng Jiang <tijiang@rim.com>
[BlackBerry] Check image node with usemap attribute isLink failed
......
......@@ -902,8 +902,12 @@ void InputHandler::setElementUnfocused(bool refocusOccuring)
frameSelection->setFocused(true);
}
m_spellingHandler->setSpellCheckActive(false);
m_processingTransactionId = 0;
// Cancel any preexisting spellcheck requests.
if (m_request) {
stopPendingSpellCheckRequests();
m_request->didCancel();
m_request = 0;
}
// Clear the node details.
m_currentFocusElement = 0;
......
......@@ -43,6 +43,9 @@ SpellingHandler::~SpellingHandler()
void SpellingHandler::spellCheckTextBlock(const WebCore::VisibleSelection& visibleSelection, WebCore::TextCheckingProcessType textCheckingProcessType)
{
SpellingLog(Platform::LogLevelInfo, "SpellingHandler::spellCheckTextBlock received request of type %s",
textCheckingProcessType == TextCheckingProcessBatch ? "Batch" : "Incremental");
// Check if this request can be sent off in one message, or if it needs to be broken down.
RefPtr<Range> rangeForSpellChecking = visibleSelection.toNormalizedRange();
if (!rangeForSpellChecking || !rangeForSpellChecking->text() || !rangeForSpellChecking->text().length())
......
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