[WK2] WTR needs an implementation of setAsynchronousSpellCheckingEnabled
authorg.czajkowski@samsung.com <g.czajkowski@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 13:29:37 +0000 (13:29 +0000)
committerg.czajkowski@samsung.com <g.czajkowski@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 13:29:37 +0000 (13:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81042

Reviewed by Enrica Casucci.

Source/WebKit2:

Expose WK2 setting to enable/disabled asynchronous spell checking.
It's used by WebKitTestRunner to reset the setting at the beginning
of the test.
WebKit2 ports might be interested in this setting if they are going
to enable this feature.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAsynchronousSpellCheckingEnabled):
(WKPreferencesGetAsynchronousSpellCheckingEnabled):
* UIProcess/API/C/WKPreferences.h:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAsynchronousSpellCheckingEnabled):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setAsynchronousSpellCheckingEnabled):
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Add setAsynchronousSpellCheckingEnabled implementation for
WebKitTestRunner to have the possibility to test asynchronous
spell checking implementation from bug 109577.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setAsynchronousSpellCheckingEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

LayoutTests:

Gardening of the asynchronous spell checking tests.

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:
Some tests need to be skipped as they require features not
implemented for EFL yet (pasteboard, grammar checking, text replacement).

* platform/gtk-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/qt-5.0-wk2/TestExpectations:
Skip asynchronous spell checking for GTK+, Mac, Qt unless
they implement TextChecker::requestCheckingOfText.

* platform/wk2/TestExpectations:
Remove asynchronous spell checking tests from global wk2's
as they are passing for EFL.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/efl-wk2/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk-wk2/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/qt-5.0-wk2/TestExpectations
LayoutTests/platform/wk2/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferences.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestController.cpp

index 7f53a28..8b04115 100644 (file)
@@ -1,3 +1,27 @@
+2013-03-05  Tim Horton  <timothy_horton@apple.com>, Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [WK2] WTR needs an implementation of setAsynchronousSpellCheckingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=81042
+
+        Reviewed by Enrica Casucci.
+
+        Gardening of the asynchronous spell checking tests.
+
+        * platform/efl-wk2/TestExpectations:
+        * platform/efl/TestExpectations:
+        Some tests need to be skipped as they require features not
+        implemented for EFL yet (pasteboard, grammar checking, text replacement).
+
+        * platform/gtk-wk2/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+        * platform/qt-5.0-wk2/TestExpectations:
+        Skip asynchronous spell checking for GTK+, Mac, Qt unless
+        they implement TextChecker::requestCheckingOfText.
+
+        * platform/wk2/TestExpectations:
+        Remove asynchronous spell checking tests from global wk2's
+        as they are passing for EFL.
+
 2013-03-05  Tommy Widenflycht  <tommyw@google.com>
 
         MediaStream API: Add the getStreamById method on RTCPeerConnection
index 937ed88..a2c2f99 100644 (file)
@@ -325,8 +325,14 @@ Bug(EFL) fast/events/touch/basic-single-touch-events.html [ Failure ]
 
 # Needs grammar checking
 Bug(EFL) editing/spelling/grammar-edit-word.html [ Failure ]
+Bug(EFL) editing/spelling/grammar-markers.html [ Failure ]
+Bug(EFL) editing/spelling/grammar-markers-hidpi.html [ Failure ]
+Bug(EFL) editing/spelling/grammar-paste.html [ Failure ]
 Bug(EFL) editing/spelling/markers.html [ Failure ]
 
+# EFL's text checker doesn't support the text replacement feature.
+Bug(EFL) editing/spelling/spelling-marker-description.html [ Failure ]
+
 # Fails because MutationObservers are not notified at end-of-task.
 webkit.org/b/78290 fast/dom/MutationObserver/end-of-task-delivery.html [ Failure ]
 
index 8ada7c0..c5ec87f 100644 (file)
@@ -1021,6 +1021,10 @@ webkit.org/b/84338 editing/pasteboard/smart-paste-006.html [ Failure ]
 webkit.org/b/84338 editing/pasteboard/smart-paste-in-text-control.html [ Failure ]
 webkit.org/b/84338 editing/pasteboard/style-from-rules.html [ Failure ]
 webkit.org/b/84338 editing/pasteboard/testcase-9507.html [ Failure ]
+webkit.org/b/84338 editing/spelling/spellcheck-async-mutation.html [ Failure ]
+webkit.org/b/84338 editing/spelling/spellcheck-queue.html [ Failure ]
+webkit.org/b/84338 editing/spelling/spellcheck-paste-disabled.html [ Failure ]
+webkit.org/b/84338 editing/spelling/spellcheck-paste.html [ Failure ]
 webkit.org/b/84338 editing/style/apply-through-end-of-document.html [ Failure ]
 webkit.org/b/84338 editing/style/non-inheritable-styles.html [ Failure ]
 webkit.org/b/84338 editing/style/smoosh-styles-003.html [ Failure ]
@@ -1413,15 +1417,6 @@ webkit.org/b/88138 http/tests/media/video-buffered.html [ Failure ]
 webkit.org/b/89830 fast/text/hyphen-min-preferred-width.html [ ImageOnlyFailure ]
 webkit.org/b/89830 fast/text/hyphenate-locale.html [ Skip ]
 
-# EFL's LayoutTestController does not implement setAsynchronousSpellCheckingEnabled
-webkit.org/b/86637 editing/spelling/spellcheck-async.html [ Failure ]
-webkit.org/b/86637 editing/spelling/spellcheck-async-mutation.html [ Failure ]
-webkit.org/b/86637 editing/spelling/spellcheck-paste.html [ Failure ]
-webkit.org/b/86637 editing/spelling/spellcheck-paste-disabled.html [ Failure ]
-webkit.org/b/86637 editing/spelling/spellcheck-queue.html [ Failure ]
-webkit.org/b/86637 editing/spelling/spellcheck-sequencenum.html [ Failure ]
-webkit.org/b/86637 editing/spelling/spelling-marker-description.html [ Failure ]
-
 # Missing test infrastructure, no gamepads available.
 Bug(EFL) gamepad/gamepad-polling-access.html [ Failure ]
 
index 2227eac..67f530f 100644 (file)
@@ -185,6 +185,17 @@ webkit.org/b/42194 fast/dom/vertical-scrollbar-in-rtl.html [ Failure ]
 webkit.org/b/42194 fast/events/5056619.html [ Failure ]
 webkit.org/b/42194 http/tests/security/drag-drop-same-unique-origin.html [ Failure ]
 
+# Missing TextChecker::requestCheckingOfString() implementation for Gtk.
+Bug(GTK) editing/spelling/grammar-markers.html [ Skip ]
+Bug(GTK) editing/spelling/grammar-paste.html [ Skip ]
+Bug(GTK) editing/spelling/grammar-markers-hidpi.html [ Skip ]
+Bug(GTK) editing/spelling/spellcheck-async-mutation.html [ Skip ]
+Bug(GTK) editing/spelling/spellcheck-async-remove-frame.html [ Skip ]
+Bug(GTK) editing/spelling/spellcheck-async.html [ Skip ]
+Bug(GTK) editing/spelling/spellcheck-queue.html [ Skip ]
+Bug(GTK) editing/spelling/spellcheck-sequencenum.html [ Skip ]
+Bug(GTK) editing/spelling/spelling-marker-description.html [ Skip ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Expected failures
 #////////////////////////////////////////////////////////////////////////////////////////
index 2ebc013..6a06cb3 100644 (file)
@@ -320,6 +320,17 @@ webkit.org/b/109890 [ Debug ] platform/mac-wk2/plugins/destroy-during-async-npp-
 ########################################
 ### START OF (2) Classified failures without bug reports (yet)
 
+# Missing TextChecker::requestCheckingOfString() implementation for Mac.
+editing/spelling/grammar-markers.html
+editing/spelling/grammar-paste.html
+editing/spelling/grammar-markers-hidpi.html
+editing/spelling/spellcheck-async-mutation.html
+editing/spelling/spellcheck-async-remove-frame.html
+editing/spelling/spellcheck-async.html
+editing/spelling/spellcheck-queue.html
+editing/spelling/spellcheck-sequencenum.html
+editing/spelling/spelling-marker-description.html
+
 ### END OF (2) Classified failures without bug reports (yet)
 ########################################
 
index 2e65e4d..6147d1f 100644 (file)
@@ -738,3 +738,14 @@ webkit.org/b/105182 compositing/repaint/resize-repaint.html
 svg/text/select-textLength-spacing-stretch-1.svg
 svg/text/select-x-list-with-tspans-1.svg
 svg/text/select-x-list-1.svg
+
+# Missing TextChecker::requestCheckingOfString() implementation for Qt.
+editing/spelling/grammar-markers.html
+editing/spelling/grammar-paste.html
+editing/spelling/grammar-markers-hidpi.html
+editing/spelling/spellcheck-async-mutation.html
+editing/spelling/spellcheck-async-remove-frame.html
+editing/spelling/spellcheck-async.html
+editing/spelling/spellcheck-queue.html
+editing/spelling/spellcheck-sequencenum.html
+editing/spelling/spelling-marker-description.html
index 6c8b842..80e4ce5 100644 (file)
@@ -528,18 +528,6 @@ fast/block/lineboxcontain/block-font.html
 fast/block/lineboxcontain/block-glyphs.html
 fast/block/lineboxcontain/font.html
 
-# [WK2] WTR needs an implementation of setAsynchronousSpellCheckingEnabled.
-# https://bugs.webkit.org/show_bug.cgi?id=81042
-editing/spelling/grammar-markers.html
-editing/spelling/grammar-paste.html
-editing/spelling/grammar-markers-hidpi.html
-editing/spelling/spellcheck-async-mutation.html
-editing/spelling/spellcheck-async-remove-frame.html
-editing/spelling/spellcheck-async.html
-editing/spelling/spellcheck-queue.html
-editing/spelling/spellcheck-sequencenum.html
-editing/spelling/spelling-marker-description.html
-
 # WTR needs an implementation of setAutomaticLinkDetectionEnabled.
 # https://bugs.webkit.org/show_bug.cgi?id=87162
 editing/inserting/smart-link-when-caret-is-moved-before-URL.html
index b3fb98b..c9c869f 100644 (file)
@@ -1,3 +1,30 @@
+2013-03-05  Tim Horton  <timothy_horton@apple.com>, Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [WK2] WTR needs an implementation of setAsynchronousSpellCheckingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=81042
+
+        Reviewed by Enrica Casucci.
+
+        Expose WK2 setting to enable/disabled asynchronous spell checking.
+        It's used by WebKitTestRunner to reset the setting at the beginning
+        of the test.
+        WebKit2 ports might be interested in this setting if they are going
+        to enable this feature.
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetAsynchronousSpellCheckingEnabled):
+        (WKPreferencesGetAsynchronousSpellCheckingEnabled):
+        * UIProcess/API/C/WKPreferences.h:
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetAsynchronousSpellCheckingEnabled):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::setAsynchronousSpellCheckingEnabled):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2013-03-03  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         [WK2][EFL] Add requestCheckingOfString implementation.
index 5953cb4..9b9050e 100644 (file)
@@ -99,6 +99,7 @@ namespace WebKit {
     macro(JavaScriptCanAccessClipboard, javaScriptCanAccessClipboard, Bool, bool, false) \
     macro(ShouldPrintBackgrounds, shouldPrintBackgrounds, Bool, bool, false) \
     macro(FullScreenEnabled, fullScreenEnabled, Bool, bool, false) \
+    macro(AsynchronousSpellCheckingEnabled, asynchronousSpellCheckingEnabled, Bool, bool, false) \
     macro(WebSecurityEnabled, webSecurityEnabled, Bool, bool, true) \
     macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \
     macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \
index 323ea11..60c2dc0 100644 (file)
@@ -658,6 +658,16 @@ bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->fullScreenEnabled();
 }
 
+void WKPreferencesSetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setAsynchronousSpellCheckingEnabled(enabled);
+}
+
+bool WKPreferencesGetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->asynchronousSpellCheckingEnabled();
+}
+
 void WKPreferencesSetAVFoundationEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
     toImpl(preferencesRef)->setAVFoundationEnabled(enabled);
index d45ef02..7aed46a 100644 (file)
@@ -232,6 +232,10 @@ WK_EXPORT bool WKPreferencesGetTextAutosizingEnabled(WKPreferencesRef preference
 WK_EXPORT void WKPreferencesSetQTKitEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetQTKitEnabled(WKPreferencesRef preferencesRef);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef);
+
 #ifdef __cplusplus
 }
 #endif
index b77fd02..8fee4cc 100644 (file)
@@ -213,6 +213,11 @@ void WKBundleResetOriginAccessWhitelists(WKBundleRef bundleRef)
     toImpl(bundleRef)->resetOriginAccessWhitelists();
 }
 
+void WKBundleSetAsynchronousSpellCheckingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
+{
+    toImpl(bundleRef)->setAsynchronousSpellCheckingEnabled(toImpl(pageGroupRef), enabled);
+}
+
 void WKBundleReportException(JSContextRef context, JSValueRef exception)
 {
     InjectedBundle::reportException(context, exception);
index 886cde3..af18e3c 100644 (file)
@@ -67,6 +67,7 @@ WK_EXPORT void WKBundleSetWebNotificationPermission(WKBundleRef bundle, WKBundle
 WK_EXPORT void WKBundleRemoveAllWebNotificationPermissions(WKBundleRef bundle, WKBundlePageRef page);
 WK_EXPORT uint64_t WKBundleGetWebNotificationID(WKBundleRef bundle, JSContextRef context, JSValueRef notification);
 WK_EXPORT WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data);
+WK_EXPORT void WKBundleSetAsynchronousSpellCheckingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled);
 
 // UserContent API
 WK_EXPORT void WKBundleAddUserScript(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld, WKStringRef source, WKURLRef url, WKArrayRef whitelist, WKArrayRef blacklist, WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames);
index dcd063d..1ad24cf 100644 (file)
@@ -347,6 +347,13 @@ void InjectedBundle::resetOriginAccessWhitelists()
     SecurityPolicy::resetOriginAccessWhitelists();
 }
 
+void InjectedBundle::setAsynchronousSpellCheckingEnabled(WebPageGroupProxy* pageGroup, bool enabled)
+{
+    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
+    for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
+        (*iter)->settings()->setAsynchronousSpellCheckingEnabled(enabled);
+}
+
 void InjectedBundle::clearAllDatabases()
 {
 #if ENABLE(SQL_DATABASE)
index 52117ea..3fe9d2d 100644 (file)
@@ -119,6 +119,7 @@ public:
     void addOriginAccessWhitelistEntry(const String&, const String&, const String&, bool);
     void removeOriginAccessWhitelistEntry(const String&, const String&, const String&, bool);
     void resetOriginAccessWhitelists();
+    void setAsynchronousSpellCheckingEnabled(WebPageGroupProxy*, bool);
     int numberOfPages(WebFrame*, double, double);
     int pageNumberForElementById(WebFrame*, const String&, double, double);
     String pageSizeAndMarginsInPixels(WebFrame*, int, int, int, int, int, int, int);
index 60883c8..ed0ac10 100644 (file)
@@ -2401,6 +2401,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 #endif
 
     settings->setLogsPageMessagesToSystemConsoleEnabled(store.getBoolValueForKey(WebPreferencesKey::logsPageMessagesToSystemConsoleEnabledKey()));
+    settings->setAsynchronousSpellCheckingEnabled(store.getBoolValueForKey(WebPreferencesKey::asynchronousSpellCheckingEnabledKey()));
 
     settings->setSmartInsertDeleteEnabled(store.getBoolValueForKey(WebPreferencesKey::smartInsertDeleteEnabledKey()));
     settings->setShowsURLsInToolTips(store.getBoolValueForKey(WebPreferencesKey::showsURLsInToolTipsEnabledKey()));
index c9ec658..e8c6f34 100644 (file)
@@ -1,3 +1,21 @@
+2013-03-05  Tim Horton  <timothy_horton@apple.com>, Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [WK2] WTR needs an implementation of setAsynchronousSpellCheckingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=81042
+
+        Reviewed by Enrica Casucci.
+
+        Add setAsynchronousSpellCheckingEnabled implementation for
+        WebKitTestRunner to have the possibility to test asynchronous
+        spell checking implementation from bug 109577.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setAsynchronousSpellCheckingEnabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetStateToConsistentValues):
+
 2013-03-05  Tommy Widenflycht  <tommyw@google.com>
 
         MediaStream API: Add the getStreamById method on RTCPeerConnection
index d765607..5071474 100644 (file)
@@ -71,6 +71,7 @@ interface TestRunner {
     void setSerializeHTTPLoads();
     void dispatchPendingLoadRequests();
     void setCacheModel(in int model);
+    void setAsynchronousSpellCheckingEnabled(in boolean value);
 
     // Special DOM functions.
     void clearBackForwardList();
index 1113d45..5ed19ea 100644 (file)
@@ -651,6 +651,11 @@ void TestRunner::setCacheModel(int model)
     WKBundleSetCacheModel(InjectedBundle::shared().bundle(), model);
 }
 
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool enabled)
+{
+    WKBundleSetAsynchronousSpellCheckingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
+}
+
 void TestRunner::grantWebNotificationPermission(JSStringRef origin)
 {
     WKRetainPtr<WKStringRef> originWK = toWK(origin);
index f863832..60f8a6d 100644 (file)
@@ -115,6 +115,7 @@ public:
     void setSerializeHTTPLoads();
     void dispatchPendingLoadRequests();
     void setCacheModel(int);
+    void setAsynchronousSpellCheckingEnabled(bool);
 
     // Special DOM functions.
     void clearBackForwardList();
index a05f1af..0f28d03 100644 (file)
@@ -569,6 +569,7 @@ bool TestController::resetStateToConsistentValues()
 #endif
     WKPreferencesSetScreenFontSubstitutionEnabled(preferences, true);
     WKPreferencesSetInspectorUsesWebKitUserInterface(preferences, true);
+    WKPreferencesSetAsynchronousSpellCheckingEnabled(preferences, false);
 #if !PLATFORM(MAC)
     WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
 #endif