[Webkit-unassigned] [Bug 22551] [GTK] API to start inspector for a WebView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 27 07:23:53 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=22551





--- Comment #24 from Xan Lopez <xan.lopez at gmail.com>  2009-10-27 07:23:54 PDT ---
(From update of attachment 41940)
>+/**
>+ * webkit_web_inspector_inspect_coordinates:
>+ * @web_inspector: the #WebKitWebInspector that will do the inspection
>+ * @x: the X coordinate of the node to be inspected
>+ * @y: the Y coordinate of the node to be inspected
>+ *
>+ * Causes the Web Inspector to inspect the node that is located at the
>+ * given coordinates.
>+ */

Missing the "Since:" stuff.

>+void webkit_web_inspector_inspect_coordinates(WebKitWebInspector* webInspector, gdouble x, gdouble y)
>+{
>+    g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(webInspector));

Perhaps you could check the coordinates are not negative, while you are it.

>+
>+    WebKitWebInspectorPrivate* priv = webInspector->priv;
>+
>+    Frame* frame = priv->page->focusController()->focusedOrMainFrame();
>+    FrameView* view = frame->view();
>+
>+    if (!view)
>+        return;
>+
>+    HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
>+    IntPoint documentPoint = view->windowToContents(IntPoint(static_cast<int>(x), static_cast<int>(y)));
>+    HitTestResult result(documentPoint);
>+
>+    frame->contentRenderer()->layer()->hitTest(request, result);
>+    priv->page->inspectorController()->inspect(result.innerNonSharedNode());
>+}

Looks good to me otherwise, you have my 1/2 r+.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list