Title: [140973] trunk/Source/WebKit/blackberry
- Revision
- 140973
- Author
- commit-qu...@webkit.org
- Date
- 2013-01-28 08:59:07 -0800 (Mon, 28 Jan 2013)
Log Message
[BlackBerry] SpellingHandler parses and creates spellcheck requests regardless of the system spell check status
https://bugs.webkit.org/show_bug.cgi?id=108085
PR 286165
Patch by Otto Derek Cheung <otche...@rim.com> on 2013-01-28
Reviewed by Rob Buis.
Internally reviewed by Nima Ghanavatian.
Adding a check for the system spell check status in InputHandler::shouldSpellCheckElement so
we won't bother sending a spellcheck request if system spell check is turned off.
However, on a fresh browser start up and on the first setElementFocus, the spellcheck value isn't defined yet.
The first spell check request is therefore necessary to connect to imf to determine whether spell check is turned on.
If spell check is turned off, we will turn spellinghandler off.
Tested the patch using a test site that contains editable text in text-areas and content-editable divs. Also tested on
an extreme test case where we try to edit a content-editable div with 30000 characters. Confirmed spell-check requests are
being canceled if system spell check is off.
In theory, this patch should also fix PR 284229 . However, because of issues with getting the system spell check values from IMF,
additional work needs to be done for that PR.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::setSpellCheckingEnabled):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::InputHandler):
(BlackBerry::WebKit::InputHandler::shouldSpellCheckElement):
(WebKit):
(BlackBerry::WebKit::InputHandler::stopPendingSpellCheckRequests):
* WebKitSupport/InputHandler.h:
(InputHandler):
(BlackBerry::WebKit::InputHandler::setSystemSpellCheckStatus):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (140972 => 140973)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-01-28 16:58:19 UTC (rev 140972)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-01-28 16:59:07 UTC (rev 140973)
@@ -4392,6 +4392,11 @@
void WebPage::setSpellCheckingEnabled(bool enabled)
{
static_cast<EditorClientBlackBerry*>(d->m_page->editorClient())->enableSpellChecking(enabled);
+
+ d->m_inputHandler->setSystemSpellCheckStatus(enabled);
+
+ if (!enabled)
+ d->m_inputHandler->stopPendingSpellCheckRequests();
}
void WebPage::spellCheckingRequestCancelled(int32_t transactionId)
Modified: trunk/Source/WebKit/blackberry/ChangeLog (140972 => 140973)
--- trunk/Source/WebKit/blackberry/ChangeLog 2013-01-28 16:58:19 UTC (rev 140972)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2013-01-28 16:59:07 UTC (rev 140973)
@@ -1,3 +1,37 @@
+2013-01-28 Otto Derek Cheung <otche...@rim.com>
+
+ [BlackBerry] SpellingHandler parses and creates spellcheck requests regardless of the system spell check status
+ https://bugs.webkit.org/show_bug.cgi?id=108085
+ PR 286165
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Nima Ghanavatian.
+
+ Adding a check for the system spell check status in InputHandler::shouldSpellCheckElement so
+ we won't bother sending a spellcheck request if system spell check is turned off.
+
+ However, on a fresh browser start up and on the first setElementFocus, the spellcheck value isn't defined yet.
+ The first spell check request is therefore necessary to connect to imf to determine whether spell check is turned on.
+ If spell check is turned off, we will turn spellinghandler off.
+
+ Tested the patch using a test site that contains editable text in text-areas and content-editable divs. Also tested on
+ an extreme test case where we try to edit a content-editable div with 30000 characters. Confirmed spell-check requests are
+ being canceled if system spell check is off.
+
+ In theory, this patch should also fix PR 284229 . However, because of issues with getting the system spell check values from IMF,
+ additional work needs to be done for that PR.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::setSpellCheckingEnabled):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::InputHandler):
+ (BlackBerry::WebKit::InputHandler::shouldSpellCheckElement):
+ (WebKit):
+ (BlackBerry::WebKit::InputHandler::stopPendingSpellCheckRequests):
+ * WebKitSupport/InputHandler.h:
+ (InputHandler):
+ (BlackBerry::WebKit::InputHandler::setSystemSpellCheckStatus):
+
2013-01-25 Andrew Lo <a...@rim.com>
[BlackBerry] Pop-up WebViews should not take ownership of the backing store.
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (140972 => 140973)
--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp 2013-01-28 16:58:19 UTC (rev 140972)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp 2013-01-28 16:59:07 UTC (rev 140973)
@@ -143,6 +143,8 @@
, m_expectedKeyUpChar(0)
, m_didSpellCheckWord(false)
, m_spellingHandler(new SpellingHandler(this))
+ , m_spellCheckStatusConfirmed(false)
+ , m_globalSpellCheckStatus(false)
{
}
@@ -981,9 +983,15 @@
if (spellCheckAttr == DOMSupport::Default && (m_currentFocusElementTextEditMask & NO_AUTO_TEXT))
return false;
- return true;
+ // Check if the system spell check setting is off
+ return m_spellCheckStatusConfirmed ? m_globalSpellCheckStatus : true;
}
+void InputHandler::stopPendingSpellCheckRequests()
+{
+ m_spellingHandler->setSpellCheckActive(false);
+}
+
void InputHandler::redrawSpellCheckDialogIfRequired(const bool shouldMoveDialog)
{
if (didSpellCheckWord()) {
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h (140972 => 140973)
--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h 2013-01-28 16:58:19 UTC (rev 140972)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h 2013-01-28 16:59:07 UTC (rev 140973)
@@ -144,6 +144,7 @@
void requestCheckingOfString(PassRefPtr<WebCore::TextCheckingRequest>);
void spellCheckingRequestProcessed(int32_t transactionId, spannable_string_t*);
void spellCheckingRequestCancelled(int32_t transactionId);
+ void stopPendingSpellCheckRequests();
bool shouldRequestSpellCheckingOptionsForPoint(const Platform::IntPoint& documentContentPosition, const WebCore::Element*, imf_sp_text_t&);
void requestSpellingCheckingOptions(imf_sp_text_t&, WebCore::IntSize& screenOffset, const bool shouldMoveDialog = false);
@@ -151,7 +152,10 @@
void redrawSpellCheckDialogIfRequired(const bool shouldMoveDialog = true);
void callRequestCheckingFor(PassRefPtr<WebCore::SpellCheckRequest>);
+ void setSystemSpellCheckStatus(bool enabled) { m_spellCheckStatusConfirmed = true; m_globalSpellCheckStatus = enabled; }
+ void callRequestCheckingFor(PassRefPtr<WebCore::SpellCheckRequest>);
+
private:
enum PendingKeyboardStateChange { NoChange, Visible, NotVisible };
@@ -240,6 +244,8 @@
WebCore::IntSize m_screenOffset;
bool m_didSpellCheckWord;
SpellingHandler* m_spellingHandler;
+ bool m_spellCheckStatusConfirmed;
+ bool m_globalSpellCheckStatus;
DISABLE_COPY(InputHandler);
};
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes