summaryrefslogtreecommitdiffstats
path: root/WebKit/gtk/WebCoreSupport
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/gtk/WebCoreSupport')
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp4
-rw-r--r--WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp25
-rw-r--r--WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h3
-rw-r--r--WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp23
-rw-r--r--WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp5
5 files changed, 53 insertions, 7 deletions
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index d4ab7ab..d63317c 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -255,10 +255,6 @@ void ChromeClient::closeWindowSoon()
if (isHandled)
return;
-
- // FIXME: should we clear the frame group name here explicitly? Mac does it.
- // But this gets cleared in Page's destructor anyway.
- // webkit_web_view_set_group_name(m_webView, "");
}
bool ChromeClient::canTakeFocus(FocusDirection)
diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
index 8296206..f237e9d 100644
--- a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
@@ -19,9 +19,17 @@
#include "config.h"
#include "DumpRenderTreeSupportGtk.h"
-#include "webkitwebview.h"
+#include "APICast.h"
+#include "Document.h"
+#include "JSDocument.h"
+#include "JSLock.h"
+#include "JSNodeList.h"
+#include "JSValue.h"
+#include "NodeList.h"
#include "webkitprivate.h"
+#include "webkitwebview.h"
+using namespace JSC;
using namespace WebCore;
bool DumpRenderTreeSupportGtk::s_drtRun = false;
@@ -54,3 +62,18 @@ bool DumpRenderTreeSupportGtk::linksIncludedInFocusChain()
return s_linksIncludedInTabChain;
}
+JSValueRef DumpRenderTreeSupportGtk::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ JSLock lock(SilenceAssertionsOnly);
+ ExecState* exec = toJS(context);
+ if (!value)
+ return JSValueMakeUndefined(context);
+ JSValue jsValue = toJS(exec, value);
+ if (!jsValue.inherits(&JSDocument::s_info))
+ return JSValueMakeUndefined(context);
+
+ JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
+ Document* document = jsDocument->impl();
+ RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
+ return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
+}
diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
index 5b494ff..17e9f6d 100644
--- a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
+++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
@@ -19,6 +19,8 @@
#ifndef DumpRenderTreeSupportGtk_h
#define DumpRenderTreeSupportGtk_h
+#include "JSStringRef.h"
+
class DumpRenderTreeSupportGtk {
public:
@@ -30,6 +32,7 @@ public:
static void setLinksIncludedInFocusChain(bool);
static bool linksIncludedInFocusChain();
+ static JSValueRef nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
private:
static bool s_drtRun;
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 749efe9..e04b5f9 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -122,13 +122,25 @@ static void pasteClipboardCallback(GtkWidget* widget, EditorClient* client)
client->addPendingEditorCommand("Paste");
}
-static void toggleOverwriteCallback(GtkWidget* widget, EditorClient* client)
+static void toggleOverwriteCallback(GtkWidget* widget, EditorClient*)
{
// We don't support toggling the overwrite mode, but the default callback expects
// the GtkTextView to have a layout, so we handle this signal just to stop it.
g_signal_stop_emission_by_name(widget, "toggle-overwrite");
}
+// GTK+ will still send these signals to the web view. So we can safely stop signal
+// emission without breaking accessibility.
+static void popupMenuCallback(GtkWidget* widget, EditorClient*)
+{
+ g_signal_stop_emission_by_name(widget, "popup-menu");
+}
+
+static void showHelpCallback(GtkWidget* widget, EditorClient*)
+{
+ g_signal_stop_emission_by_name(widget, "show-help");
+}
+
static const char* const gtkDeleteCommands[][2] = {
{ "DeleteBackward", "DeleteForward" }, // Characters
{ "DeleteWordBackward", "DeleteWordForward" }, // Word ends
@@ -213,6 +225,13 @@ static void moveCursorCallback(GtkWidget* widget, GtkMovementStep step, gint cou
if (!rawCommand)
return;
+ if (isSpatialNavigationEnabled(core(client->webView())->focusController()->focusedOrMainFrame()) && step == 1) {
+ if (direction == 1)
+ rawCommand = "MoveRight";
+ else if (!direction)
+ rawCommand = "MoveLeft";
+ }
+
for (int i = 0; i < abs(count); i++)
client->addPendingEditorCommand(rawCommand);
}
@@ -782,6 +801,8 @@ EditorClient::EditorClient(WebKitWebView* webView)
g_signal_connect(m_nativeWidget.get(), "move-cursor", G_CALLBACK(moveCursorCallback), this);
g_signal_connect(m_nativeWidget.get(), "delete-from-cursor", G_CALLBACK(deleteFromCursorCallback), this);
g_signal_connect(m_nativeWidget.get(), "toggle-overwrite", G_CALLBACK(toggleOverwriteCallback), this);
+ g_signal_connect(m_nativeWidget.get(), "popup-menu", G_CALLBACK(popupMenuCallback), this);
+ g_signal_connect(m_nativeWidget.get(), "show-help", G_CALLBACK(showHelpCallback), this);
}
EditorClient::~EditorClient()
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index 2c1ffab..312b8c8 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -78,7 +78,7 @@ void InspectorClient::openInspectorFrontend(InspectorController* controller)
}
webkit_web_inspector_set_web_view(webInspector, inspectorWebView);
-
+
GOwnPtr<gchar> inspectorPath(g_build_filename(inspectorFilesPath(), "inspector.html", NULL));
GOwnPtr<gchar> inspectorURI(g_filename_to_uri(inspectorPath.get(), 0, 0));
webkit_web_view_load_uri(inspectorWebView, inspectorURI.get());
@@ -88,6 +88,9 @@ void InspectorClient::openInspectorFrontend(InspectorController* controller)
m_frontendPage = core(inspectorWebView);
m_frontendClient = new InspectorFrontendClient(m_inspectedWebView, inspectorWebView, webInspector, m_frontendPage, this);
m_frontendPage->inspectorController()->setInspectorFrontendClient(m_frontendClient);
+
+ // The inspector must be in it's own PageGroup to avoid deadlock while debugging.
+ m_frontendPage->setGroupName("");
}
void InspectorClient::releaseFrontendPage()