https://bugs.webkit.org/show_bug.cgi?id=66496
Patch by Kaustubh Atrawalkar <kaustubh@motorola.com> on 2011-09-28
Reviewed by Martin Robinson.
Source/WebKit/gtk:
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::doCommand): Function definition for doCommand
callback. Converted Incoming command to match with WebCore::Editor CommandMap.
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
Tools:
* DumpRenderTree/gtk/TextInputController.cpp:
(doCommandCallback): Callback function for textInputController.doCommand
LayoutTests:
Removed skipped tests under textInputController.doCommand for Gtk Port.
* platform/gtk/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96234
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-09-28 Kaustubh Atrawalkar <kaustubh@motorola.com>
+
+ [Gtk] Implement textInputController.doCommand
+ https://bugs.webkit.org/show_bug.cgi?id=66496
+
+ Reviewed by Martin Robinson.
+
+ Removed skipped tests under textInputController.doCommand for Gtk Port.
+
+ * platform/gtk/Skipped:
+
2011-09-28 Tom Sepez <tsepez@chromium.org>
Revert change which broke displaying end script tags in view-source, instead
# layoutTestController::setTextDirection() is not implemented.
fast/html/set-text-direction.html
-# textInputController.doCommand is not implemented.
-# https://bugs.webkit.org/show_bug.cgi?id=66496
-editing/input/password-echo-passnode.html
-editing/input/password-echo-passnode2.html
-editing/input/password-echo-passnode3.html
-editing/input/password-echo-textnode.html
-
# https://bugs.webkit.org/show_bug.cgi?id=57160
# [GTK] layoutTestController.overridePreference("WebKitDefaultFontSize"...) does not take into account screen DPI
fast/harness/override-preferences-2.html
+2011-09-28 Kaustubh Atrawalkar <kaustubh@motorola.com>
+
+ [Gtk] Implement textInputController.doCommand
+ https://bugs.webkit.org/show_bug.cgi?id=66496
+
+ Reviewed by Martin Robinson.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ (DumpRenderTreeSupportGtk::doCommand): Function definition for doCommand
+ callback. Converted Incoming command to match with WebCore::Editor CommandMap.
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+
2011-09-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Reorganize header files
editor->confirmComposition();
}
+void DumpRenderTreeSupportGtk::doCommand(WebKitWebView* webView, const char* command)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+ Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
+ if (!frame)
+ return;
+
+ Editor* editor = frame->editor();
+ if (!editor)
+ return;
+
+ String commandString(command);
+ // Remove ending : here.
+ if (commandString.endsWith(":", true))
+ commandString = commandString.left(commandString.length() - 1);
+
+ // Make the first char in upper case.
+ String firstChar = commandString.left(1);
+ commandString = commandString.right(commandString.length() - 1);
+ firstChar.makeUpper();
+ commandString.insert(firstChar, 0);
+
+ editor->command(commandString).execute();
+}
+
bool DumpRenderTreeSupportGtk::firstRectForCharacterRange(WebKitWebView* webView, int location, int length, cairo_rectangle_int_t* rect)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
static void confirmComposition(WebKitWebView*, const char*);
static bool firstRectForCharacterRange(WebKitWebView*, int location, int length, cairo_rectangle_int_t*);
static bool selectedRange(WebKitWebView*, int* start, int* length);
-
+ static void doCommand(WebKitWebView*, const char*);
// GC
static void gcCollectJavascriptObjects();
static void gcCollectJavascriptObjectsOnAlternateThread(bool waitUntilDone);
+2011-09-28 Kaustubh Atrawalkar <kaustubh@motorola.com>
+
+ [Gtk] Implement textInputController.doCommand
+ https://bugs.webkit.org/show_bug.cgi?id=66496
+
+ Reviewed by Martin Robinson.
+
+ * DumpRenderTree/gtk/TextInputController.cpp:
+ (doCommandCallback): Callback function for textInputController.doCommand
+
2011-09-28 David Levin <levin@chromium.org>
watchlist: Suggest corrections for typos and improve error message consistency.
return arrayObject;
}
+static JSValueRef doCommandCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSStringRef string = JSValueToStringCopy(context, arguments[0], exception);
+ ASSERT(!exception || !*exception);
+
+ size_t bufferSize = JSStringGetMaximumUTF8CStringSize(string);
+ GOwnPtr<gchar> stringBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+ JSStringGetUTF8CString(string, stringBuffer.get(), bufferSize);
+ JSStringRelease(string);
+
+ DumpRenderTreeSupportGtk::doCommand(view, stringBuffer.get());
+ return JSValueMakeUndefined(context);
+}
+
static JSStaticFunction staticFunctions[] = {
{ "setMarkedText", setMarkedTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "hasMarkedText", hasMarkedTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "unmarkText", unmarkTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "firstRectForCharacterRange", firstRectForCharacterRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "selectedRange", selectedRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "doCommand", doCommandCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};