Convert hasGrammarMarker to use Internals interface
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 04:15:47 +0000 (04:15 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 04:15:47 +0000 (04:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82004

Reviewed by Ryosuke Niwa.

Source/WebCore:

Remove hasGrammarMarker functions, because it is able to work in the
cross-port way through the Internals interface.

No new tests, since we are improving here the infra-structure
for testing a specific method.

* testing/Internals.cpp:
(WebCore::Internals::hasGrammarMarker):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Source/WebKit/mac:

Remove hasGrammarMarker support, since it can support in the cross-port way
through the Internals interface.

* WebKit.order:
* WebView/WebFrame.mm:
* WebView/WebFramePrivate.h:

Tools:

Remove hasGrammarMarker functions, because it is able to work in the
cross-port way through the Internals interface.

* DumpRenderTree/LayoutTestController.cpp:
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
(LayoutTestController):
* DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp:
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
* DumpRenderTree/wx/LayoutTestControllerWx.cpp:

LayoutTests:

Adjust hasGrammarMarker tests to use Internals instead of LayoutTestController
interface.

* editing/spelling/grammar.html:
* platform/efl/Skipped:

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

19 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/spelling/grammar.html
Source/WebCore/ChangeLog
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebKit.order
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebFramePrivate.h
Tools/ChangeLog
Tools/DumpRenderTree/LayoutTestController.cpp
Tools/DumpRenderTree/LayoutTestController.h
Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp

index da08a51ba037e4f9e6c0903d53e7f88b9315de95..5043a0a23be1559c3a8a0c5fa3d2c7e3de93b5c2 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Convert hasGrammarMarker to use Internals interface
+        https://bugs.webkit.org/show_bug.cgi?id=82004
+
+        Reviewed by Ryosuke Niwa.
+
+        Adjust hasGrammarMarker tests to use Internals instead of LayoutTestController
+        interface.
+
+        * editing/spelling/grammar.html:
+        * platform/efl/Skipped:
+
 2012-03-22  Xingnan Wang  <xingnan.wang@intel.com>
 
         Add exception for the setter of "fftSize" in RealtimeAnalyserNode
index f37bcd0609b966ed7c4a6162f0b9cc7a8c1bf4ee..a666abcb7771ba293f61a1af95deeb0608e5e917 100644 (file)
@@ -24,7 +24,7 @@ function editingTest() {
     document.execCommand("InsertText", false, "I have a issue.");
 
     if (window.layoutTestController) {
-        if (layoutTestController.hasGrammarMarker(7, 1))
+        if (internals.hasGrammarMarker(document, 7, 1))
             log("PASS");
         else
             log("FAIL");
index 31b43e3bf22581c3a9e3c306a2a53be77e9a713f..2a2daf4e4faea652c1550fd07df0e32fbb7f000c 100644 (file)
@@ -1,3 +1,23 @@
+2012-03-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Convert hasGrammarMarker to use Internals interface
+        https://bugs.webkit.org/show_bug.cgi?id=82004
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove hasGrammarMarker functions, because it is able to work in the
+        cross-port way through the Internals interface.
+
+        No new tests, since we are improving here the infra-structure
+        for testing a specific method.
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::hasGrammarMarker):
+        (WebCore):
+        * testing/Internals.h:
+        (Internals):
+        * testing/Internals.idl:
+
 2012-03-22  Xingnan Wang  <xingnan.wang@intel.com>
 
         Add exception for the setter of "fftSize" in RealtimeAnalyserNode
index aa1c42324aca00a2d17fcbac5d717834412874fd..6f2ee33a7ab68f26fd107197e818766af19f5067 100644 (file)
@@ -783,4 +783,12 @@ unsigned Internals::numberOfLiveDocuments() const
 }
 #endif // ENABLE(INSPECTOR)
 
+bool Internals::hasGrammarMarker(Document* document, int from, int length, ExceptionCode&)
+{
+    if (!document || !document->frame())
+        return 0;
+
+    return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length);
+}
+
 }
index fddcd2548c9d282635a628271f03943eaa57a5bf..75ed7e26e99d9f8a301229c80ffb7ee05de94de1 100644 (file)
@@ -138,6 +138,7 @@ public:
     void emitInspectorDidCancelFrame();
 
     bool hasSpellingMarker(Document*, int from, int length, ExceptionCode&);
+    bool hasGrammarMarker(Document*, int from, int length, ExceptionCode&);
 
     static const char* internalsId;
 
index 264ae9da1ed8b1177b9fc4a10bbf3451a31d8233..f2200ffc4b159a0768ffdfaf602fc70f49875034 100644 (file)
@@ -114,6 +114,7 @@ module window {
         void emitInspectorDidCancelFrame();
 
         boolean hasSpellingMarker(in Document document, in long from, in long length) raises (DOMException);
+        boolean hasGrammarMarker(in Document document, in long from, in long length) raises (DOMException);
 
         readonly attribute InternalSettings settings;
 
index a0ac6c80caeea4d00ff0cfa6a85db02e777cc207..45ab0200d3d423505b9d95c64b6813457b05c5aa 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Convert hasGrammarMarker to use Internals interface
+        https://bugs.webkit.org/show_bug.cgi?id=82004
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove hasGrammarMarker support, since it can support in the cross-port way
+        through the Internals interface.
+
+        * WebKit.order:
+        * WebView/WebFrame.mm:
+        * WebView/WebFramePrivate.h:
+
 2012-03-22  Benjamin Poulain  <bpoulain@apple.com>
 
         Build fix for WebHistory is busted after changing time zone
index 5b5849705c4504278d466b95c2fd48d411e986c8..9a1063956292155c46431be41f441307e1eb72ce 100644 (file)
@@ -1691,7 +1691,6 @@ __ZThn8_N15WebEditorClient17getGuessesForWordERKN3WTF6StringES3_RNS0_6VectorIS1_
 __ZN15WebEditorClient17getGuessesForWordERKN3WTF6StringES3_RNS0_6VectorIS1_Lm0EEE
 __ZN3WTF6VectorINS_6StringELm0EE14shrinkCapacityEm
 __ZN15WebEditorClient34updateSpellingUIWithMisspelledWordERKN3WTF6StringE
--[WebFrame(WebPrivate) hasGrammarMarker:length:]
 __ZThn8_N15WebEditorClient23requestCheckingOfStringEPN7WebCore12SpellCheckerEijRKN3WTF6StringE
 __ZN15WebEditorClient23requestCheckingOfStringEPN7WebCore12SpellCheckerEijRKN3WTF6StringE
 ___copy_helper_block_1
index 44609c17862f2ec84b0f604915c69dea7a3f9331..d893171c09aec674713bbec0482724150cc7578e 100644 (file)
@@ -1223,14 +1223,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     return coreFrame->layerTreeAsText();
 }
 
-- (BOOL)hasGrammarMarker:(int)from length:(int)length
-{
-    Frame* coreFrame = core(self);
-    if (!coreFrame)
-        return NO;
-    return coreFrame->editor()->selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length);
-}
-
 - (id)accessibilityRoot
 {
 #if HAVE(ACCESSIBILITY)
index 138a0f44937e4493ac96d77c31099ce299abb91e..cb521c3ea436cf3638d19e2b81538b81250af924 100644 (file)
@@ -136,8 +136,6 @@ typedef enum {
 
 - (NSString*)_layerTreeAsText;
 
-- (BOOL)hasGrammarMarker:(int)from length:(int)length;
-
 // The top of the accessibility tree.
 - (id)accessibilityRoot;
 
index ff8b60d6ed51df75d8237f3163981df5e68bcc4d..89250064ba74ff70c07c3ac811af63fc9dc3e18c 100644 (file)
@@ -1,3 +1,24 @@
+2012-03-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Convert hasGrammarMarker to use Internals interface
+        https://bugs.webkit.org/show_bug.cgi?id=82004
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove hasGrammarMarker functions, because it is able to work in the
+        cross-port way through the Internals interface.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        (LayoutTestController):
+        * DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp:
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+
 2012-03-22  Adam Barth  <abarth@webkit.org>
 
         sync-master-with-upstream creates non-linear git history
index 6683ce974be611f249e9a9f328451c1c1ce1eaca..e51d0ee74e02a68729a76627dfc322fad31cac89 100644 (file)
@@ -2034,19 +2034,6 @@ static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function,
     return JSValueMakeUndefined(context);
 }
 
-static JSValueRef hasGrammarMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    if (argumentCount != 2)
-        return JSValueMakeUndefined(context);
-    
-    int from = JSValueToNumber(context, arguments[0], 0);
-    int length = JSValueToNumber(context, arguments[1], 0);
-    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    bool ok = controller->hasGrammarMarker(from, length);
-    
-    return JSValueMakeBoolean(context, ok);
-}
-
 static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -2358,7 +2345,6 @@ JSStaticFunction* LayoutTestController::staticFunctions()
         { "originsWithApplicationCache", originsWithApplicationCacheCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "goBack", goBackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 
         { "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 
-        { "hasGrammarMarker", hasGrammarMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "ignoreDesktopNotificationPermissionRequests", ignoreDesktopNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "isPageBoxVisible", isPageBoxVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index 5310c66e8699968408f8d7581f9f12ba1f566def..e2fae7ec82b7a6f17115c0b9c857d67b1ce65e46 100644 (file)
@@ -328,8 +328,6 @@ public:
 
     void abortModal();
 
-    bool hasGrammarMarker(int from, int length);
-
     void dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
 
     static void setSerializeHTTPLoads(bool serialize);
index 7a159eab01e85ee12e42b80c2f66412ad0f02a26..f17350645e4fd97fd7ea1de1b946276d4661463e 100644 (file)
@@ -792,14 +792,6 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
     return DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page());
 }
 
-bool LayoutTestController::hasGrammarMarker(int from, int length)
-{
-    if (!mainFrame)
-        return false;
-
-    return mainFrame->editor()->selectionStartHasMarkerFor(WebCore::DocumentMarker::Grammar, from, length);
-}
-
 void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight)
 {
     if (!mainFrame)
index e5cdd78d797d97a6523df6d57cdb68129a4a8941..a4bf8fa1c6d16e54a971f770f0b8c423f977981f 100644 (file)
@@ -743,12 +743,6 @@ void LayoutTestController::abortModal()
     notImplemented();
 }
 
-bool LayoutTestController::hasGrammarMarker(int, int)
-{
-    notImplemented();
-    return false;
-}
-
 void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight)
 {
     DumpRenderTreeSupportEfl::dumpConfigurationForViewport(browser->mainView(),
index d4e12120aa687520d71c5da2ee5fa73af3bcfb07..375a206b74b37adc381014a6678f5d342cb6978a 100644 (file)
@@ -976,11 +976,6 @@ void LayoutTestController::abortModal()
 {
 }
 
-bool LayoutTestController::hasGrammarMarker(int from, int length)
-{
-    return false;
-}
-
 void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight)
 {
     WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
index b6155a9e46f8776c762744ddd79515a7730053a0..90e543346d94fc16b6d173bbd467aa752e50cf16 100644 (file)
@@ -1159,11 +1159,6 @@ void LayoutTestController::abortModal()
     [NSApp abortModal];
 }
 
-bool LayoutTestController::hasGrammarMarker(int from, int length)
-{
-    return [mainFrame hasGrammarMarker:from length:length];
-}
-
 void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/)
 {
 
index e639bf1d2c9250dd96073be294092b94c3f031d6..80941b8e0672daf4057e1fe07fa0358e0facba1c 100644 (file)
@@ -1449,12 +1449,6 @@ void LayoutTestController::abortModal()
 {
 }
 
-bool LayoutTestController::hasGrammarMarker(int from, int length)
-{
-    // FIXME: Implement this.
-    return false;
-}
-
 void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/)
 {
     // FIXME: Implement this.
index fc6a2691297f5503bb20c4a29fba493a517e447a..5ba95874bb293df2e72eea78f1285f79a9b28f57 100644 (file)
@@ -550,12 +550,6 @@ void LayoutTestController::abortModal()
 {
 }
 
-bool LayoutTestController::hasGrammarMarker(int, int)
-{
-    // FIXME: Implement
-    return false;
-}
-
 void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/)
 {
     // FIXME: Implement