Title: [206091] trunk/Source
Revision
206091
Author
commit-qu...@webkit.org
Date
2016-09-19 02:39:56 -0700 (Mon, 19 Sep 2016)

Log Message

Web Inspector: Bring the inspected page's window forward when activating element search
https://bugs.webkit.org/show_bug.cgi?id=162114
<rdar://problem/28349357>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-09-19
Reviewed by Brian Burg.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::didSetSearchingForNode):
When element search is activated bring the window
containing the inspected page to the foreground.

Source/WebKit2:

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::elementSelectionChanged):
When element search is activated allow the platform to bring
the window containing the inspected page to the foreground.

(WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
Default empty implementation for ports.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
Bring the window containing the inspected page to the foreground.

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (206090 => 206091)


--- trunk/Source/WebKit/mac/ChangeLog	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-09-19 09:39:56 UTC (rev 206091)
@@ -1,3 +1,16 @@
+2016-09-19  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Bring the inspected page's window forward when activating element search
+        https://bugs.webkit.org/show_bug.cgi?id=162114
+        <rdar://problem/28349357>
+
+        Reviewed by Brian Burg.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorClient::didSetSearchingForNode):
+        When element search is activated bring the window
+        containing the inspected page to the foreground.
+
 2016-09-15  Brady Eidson  <beid...@apple.com>
 
         WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources).

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm (206090 => 206091)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2016-09-19 09:39:56 UTC (rev 206091)
@@ -160,9 +160,11 @@
 
     ASSERT(isMainThread());
 
-    if (enabled)
+    if (enabled) {
+        [[m_inspectedWebView window] makeKeyAndOrderFront:nil];
+        [[m_inspectedWebView window] makeFirstResponder:m_inspectedWebView];
         [[NSNotificationCenter defaultCenter] postNotificationName:WebInspectorDidStartSearchingForNode object:inspector];
-    else
+    } else
         [[NSNotificationCenter defaultCenter] postNotificationName:WebInspectorDidStopSearchingForNode object:inspector];
 }
 

Modified: trunk/Source/WebKit2/ChangeLog (206090 => 206091)


--- trunk/Source/WebKit2/ChangeLog	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit2/ChangeLog	2016-09-19 09:39:56 UTC (rev 206091)
@@ -1,3 +1,28 @@
+2016-09-19  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Bring the inspected page's window forward when activating element search
+        https://bugs.webkit.org/show_bug.cgi?id=162114
+        <rdar://problem/28349357>
+
+        Reviewed by Brian Burg.
+
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::elementSelectionChanged):
+        When element search is activated allow the platform to bring
+        the window containing the inspected page to the foreground.
+
+        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
+        * UIProcess/efl/WebInspectorProxyEfl.cpp:
+        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
+        Default empty implementation for ports.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
+        Bring the window containing the inspected page to the foreground.
+
 2016-09-18  Michael Catanzaro  <mcatanz...@igalia.com>
 
         [GTK] Empty referer header after WebKit session state restoration trips Bad Behavior Wordpress plugin

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (206090 => 206091)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-09-19 09:39:56 UTC (rev 206091)
@@ -598,7 +598,9 @@
         return;
     }
 
-    if (!active && isConnected())
+    if (active)
+        platformBringInspectedPageToFront();
+    else if (isConnected())
         bringToFront();
 }
 
@@ -660,6 +662,11 @@
     notImplemented();
 }
 
+void WebInspectorProxy::platformBringInspectedPageToFront()
+{
+    notImplemented();
+}
+
 void WebInspectorProxy::platformHide()
 {
     notImplemented();

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (206090 => 206091)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2016-09-19 09:39:56 UTC (rev 206091)
@@ -179,6 +179,7 @@
     void platformDidCloseForCrash();
     void platformInvalidate();
     void platformBringToFront();
+    void platformBringInspectedPageToFront();
     void platformHide();
     bool platformIsFront();
     void platformAttachAvailabilityChanged(bool);

Modified: trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp (206090 => 206091)


--- trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2016-09-19 09:39:56 UTC (rev 206091)
@@ -164,6 +164,11 @@
     notImplemented();
 }
 
+void WebInspectorProxy::platformBringInspectedPageToFront()
+{
+    notImplemented();
+}
+
 bool WebInspectorProxy::platformIsFront()
 {
     notImplemented();

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (206090 => 206091)


--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2016-09-19 09:39:56 UTC (rev 206091)
@@ -237,6 +237,11 @@
         gtk_window_present(GTK_WINDOW(parent));
 }
 
+void WebInspectorProxy::platformBringInspectedPageToFront()
+{
+    notImplemented();
+}
+
 bool WebInspectorProxy::platformIsFront()
 {
     GtkWidget* parent = gtk_widget_get_toplevel(m_inspectorView);

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (206090 => 206091)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2016-09-19 09:00:38 UTC (rev 206090)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2016-09-19 09:39:56 UTC (rev 206091)
@@ -394,6 +394,11 @@
     [m_inspectorView.get().window makeFirstResponder:m_inspectorView.get()];
 }
 
+void WebInspectorProxy::platformBringInspectedPageToFront()
+{
+    [inspectedPage()->platformWindow() makeKeyAndOrderFront:nil];
+}
+
 bool WebInspectorProxy::platformIsFront()
 {
     // FIXME <rdar://problem/10937688>: this will not return false for a background tab in Safari, only a background window.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to