Title: [229283] trunk
Revision
229283
Author
[email protected]
Date
2018-03-05 06:44:20 -0800 (Mon, 05 Mar 2018)

Log Message

[GTK] Implement WTR's PlatformWebView::setWindowIsKey()
https://bugs.webkit.org/show_bug.cgi?id=183143

Reviewed by Carlos Garcia Campos.

Tools:

Implement ::setWindowIsKey() by keeping a second window to be
presented when the webview's window is to lose its key status.

* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::~PlatformWebView):
(WTR::PlatformWebView::setWindowIsKey):

LayoutTests:

* platform/gtk/TestExpectations: Unmark the passing tests

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (229282 => 229283)


--- trunk/LayoutTests/ChangeLog	2018-03-05 13:28:35 UTC (rev 229282)
+++ trunk/LayoutTests/ChangeLog	2018-03-05 14:44:20 UTC (rev 229283)
@@ -1,3 +1,12 @@
+2018-03-05  Claudio Saavedra  <[email protected]>
+
+        [GTK] Implement WTR's PlatformWebView::setWindowIsKey()
+        https://bugs.webkit.org/show_bug.cgi?id=183143
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations: Unmark the passing tests
+
 2018-03-04  Per Arne Vollan  <[email protected]>
 
         Mark http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html as failure on Windows.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (229282 => 229283)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2018-03-05 13:28:35 UTC (rev 229282)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2018-03-05 14:44:20 UTC (rev 229283)
@@ -2383,20 +2383,7 @@
 webkit.org/b/157179 fast/events/drag-and-drop-autoscroll-inner-frame.html [ Timeout ]
 webkit.org/b/157179 fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html [ Timeout ]
 
-# testRunner.setWindowIsKey() has no effect on the web process side in WebKit2
-webkit.org/b/183143 fast/dom/Window/window-focus-self.html
 webkit.org/b/183143 fast/events/blur-focus-window-should-blur-focus-element.html
-webkit.org/b/183143 fast/selectors/querySelector-window-inactive.html
-webkit.org/b/183143 fast/selectors/selection-window-inactive.html
-webkit.org/b/183143 scrollbars/corner-resizer-window-inactive.html
-webkit.org/b/183143 fast/selectors/selection-window-inactive-stroke-color-expected.html
-webkit.org/b/183143 fast/selectors/selection-window-inactive-stroke-color.html
-webkit.org/b/183143 fast/selectors/selection-window-inactive-text-shadow-expected.html
-webkit.org/b/183143 fast/selectors/selection-window-inactive-text-shadow.html
-webkit.org/b/183143 fast/selectors/text-field-selection-window-inactive-stroke-color-expected.html
-webkit.org/b/183143 fast/selectors/text-field-selection-window-inactive-stroke-color.html
-webkit.org/b/183143 fast/selectors/text-field-selection-window-inactive-text-shadow-expected.html
-webkit.org/b/183143 fast/selectors/text-field-selection-window-inactive-text-shadow.html
 
 # Need support for internals.settings.setDeviceSupportsMouse
 fast/events/touch/scroll-without-mouse-lacks-mousemove-events.html

Modified: trunk/Tools/ChangeLog (229282 => 229283)


--- trunk/Tools/ChangeLog	2018-03-05 13:28:35 UTC (rev 229282)
+++ trunk/Tools/ChangeLog	2018-03-05 14:44:20 UTC (rev 229283)
@@ -1,3 +1,19 @@
+2018-03-05  Claudio Saavedra  <[email protected]>
+
+        [GTK] Implement WTR's PlatformWebView::setWindowIsKey()
+        https://bugs.webkit.org/show_bug.cgi?id=183143
+
+        Reviewed by Carlos Garcia Campos.
+
+        Implement ::setWindowIsKey() by keeping a second window to be
+        presented when the webview's window is to lose its key status.
+
+        * WebKitTestRunner/PlatformWebView.h:
+        * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::~PlatformWebView):
+        (WTR::PlatformWebView::setWindowIsKey):
+
 2018-03-05  Yusuke Suzuki  <[email protected]>
 
         Unreviewed, attempt to fix Apple port build

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (229282 => 229283)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2018-03-05 13:28:35 UTC (rev 229282)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2018-03-05 14:44:20 UTC (rev 229283)
@@ -114,6 +114,9 @@
     PlatformWindow m_window;
     bool m_windowIsKey;
     const TestOptions m_options;
+#if PLATFORM(GTK)
+    GtkWidget* m_otherWindow { nullptr };
+#endif
 };
 
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp (229282 => 229283)


--- trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp	2018-03-05 13:28:35 UTC (rev 229282)
+++ trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp	2018-03-05 14:44:20 UTC (rev 229283)
@@ -57,11 +57,32 @@
 PlatformWebView::~PlatformWebView()
 {
     gtk_widget_destroy(m_window);
+    if (m_otherWindow)
+        gtk_widget_destroy(m_otherWindow);
 }
 
 void PlatformWebView::setWindowIsKey(bool isKey)
 {
+    if (m_windowIsKey == isKey)
+        return;
+
     m_windowIsKey = isKey;
+
+    if (isKey) {
+        if (m_otherWindow) {
+            gtk_widget_destroy(m_otherWindow);
+            m_otherWindow = nullptr;
+        }
+        gtk_window_present(GTK_WINDOW(m_window));
+    } else {
+        ASSERT(!m_otherWindow);
+        m_otherWindow = gtk_window_new(GTK_WINDOW_POPUP);
+        gtk_widget_show_all(m_otherWindow);
+        gtk_window_present(GTK_WINDOW(m_otherWindow));
+    }
+
+    while (gtk_events_pending())
+        gtk_main_iteration();
 }
 
 void PlatformWebView::resizeTo(unsigned width, unsigned height, WebViewSizingMode sizingMode)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to