[GTK] Fix the handling of resize events after r169505.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jun 2014 22:27:16 +0000 (22:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jun 2014 22:27:16 +0000 (22:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133517

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-06-17
Reviewed by Martin Robinson.

Tools:
* Scripts/webkitpy/port/xvfbdriver.py:
(XvfbDriver._start): Set the resolution of Xvfb to XGA (1024x768).
The tests css3/viewport-percentage-lengths/viewport-percentage-lengths-*.html
need at least 900x640 pixels to pass.
* Scripts/webkitpy/port/xvfbdriver_unittest.py:
(XvfbDriverTest.test_start_no_pixel_tests): Update resolution.
(XvfbDriverTest.test_start_pixel_tests): Update resolution.
(XvfbDriverTest.test_start_arbitrary_worker_number): Update resolution.
(XvfbDriverTest.test_start_next_worker): Update resolution.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView): gtk_widget_size_allocate should
be requested over the main widget instead of the window.
(WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame like
the Mac port.
(WTR::PlatformWebView::windowFrame): Remove legacy ifdef for GTK2.
(WTR::PlatformWebView::setWindowFrame): Set the size and position
of the Window and the web view.

LayoutTests:
* platform/gtk/TestExpectations: Remove the expectations for the
tests that now pass.
* platform/gtk/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.txt:
Rebaseline results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.txt
Tools/ChangeLog
Tools/Scripts/webkitpy/port/xvfbdriver.py
Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py
Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp

index 24991a8..e9e3013 100644 (file)
@@ -1,3 +1,15 @@
+2014-06-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
+
+        [GTK] Fix the handling of resize events after r169505.
+        https://bugs.webkit.org/show_bug.cgi?id=133517
+
+        Reviewed by Martin Robinson.
+
+        * platform/gtk/TestExpectations: Remove the expectations for the
+        tests that now pass.
+        * platform/gtk/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.txt:
+        Rebaseline results.
+
 2014-06-17  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [iOS] Input type=time elements styled with SVG fonts have 0 width
index fbae419..3bc1fdb 100644 (file)
@@ -808,10 +808,6 @@ webkit.org/b/132279 perf/mouse-event.html [ Failure Pass ]
 webkit.org/b/132281 fast/workers/worker-constructor.html [ Timeout Pass ]
 webkit.org/b/132282 fast/inline-block/14498-positionForCoordinates.html [ Failure Pass ]
 
-#fast/dom/Window
-webkit.org/b/132255 fast/dom/Window/window-resize-and-move-sub-frame.html [ Timeout Pass ]
-webkit.org/b/132255 fast/dom/Window/window-resize-contents.html [ Timeout Pass ]
-
 #Fast overflow
 webkit.org/b/132258 fast/overflow/hit-test-overflow-controls.html [ Failure ImageOnlyFailure Pass ]
 webkit.org/b/132258 fast/overflow/overflow-text-hit-testing.html [ Failure Pass ]
@@ -852,8 +848,6 @@ webkit.org/b/132999 html5lib/generated/run-tests16-write.html [ Pass Timeout ]
 webkit.org/b/133000 js/slow-stress/call-spread.html [ Pass Timeout ]
 webkit.org/b/133001 fast/workers/worker-context-gc.html [ Pass Timeout ]
 
-webkit.org/b/133807 fast/dynamic/window-resize-scrollbars-test.html [ Failure Timeout ]
-
 webkit.org/b/133865 media/W3C/video/networkState/networkState_during_progress.html [ Failure Pass ]
 webkit.org/b/133866 media/media-controls-cancel-events.html [ Failure Pass ]
 webkit.org/b/133867 webaudio/audioprocessingevent.html [ Failure Pass ]
@@ -1018,11 +1012,6 @@ webkit.org/b/133148 accessibility/content-editable-set-inner-text-generates-axva
 
 webkit.org/b/133151 js/cached-window-properties.html [ Timeout Pass ]
 
-webkit.org/b/133517 css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html [ Timeout ]
-webkit.org/b/133517 css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html [ Timeout ]
-webkit.org/b/133517 css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html [ Timeout ]
-webkit.org/b/133517 css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html [ Timeout ]
-
 webkit.org/b/133808 media/video-trackmenu-selection.html [ Timeout ]
 
 #////////////////////////////////////////////////////////////////////////////////////////
@@ -1204,7 +1193,6 @@ webkit.org/b/122535 fast/dom/Window/open-window-min-size.html [ Failure ]
 Bug(GTK) editing/selection/5136696.html [ Failure ]
 Bug(GTK) editing/selection/inactive-selection.html [ Failure ]
 Bug(GTK) fast/css/disabled-author-styles.html [ Failure ]
-Bug(GTK) fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Failure ]
 Bug(GTK) fast/dom/Window/window-postmessage-clone.html [ Failure Timeout ]
 Bug(GTK) fast/events/backspace-navigates-back.html [ Failure ]
 Bug(GTK) fast/events/keydown-leftright-keys.html [ Failure ]
@@ -1329,7 +1317,6 @@ webkit.org/b/53964 fast/forms/listbox-onchange.html [ Failure ]
 webkit.org/b/53964 fast/forms/option-mouseevents.html [ Failure ]
 
 # Probably failing because resizing is asynchronous.
-webkit.org/b/53959 fast/dom/Window/window-resize-and-move-arguments.html [ Failure Timeout ]
 webkit.org/b/53959 fast/dom/Window/window-resize.html [ Failure Timeout ]
 
 # keygen element rendering is broken
@@ -1586,9 +1573,6 @@ webkit.org/b/93976 fast/css-generated-content/quotes-lang.html [ ImageOnlyFailur
 webkit.org/b/94009 css2.1/20110323/c541-word-sp-000.htm [ ImageOnlyFailure ]
 
 webkit.org/b/80129 fast/frames/flattening/frameset-flattening-advanced.html [ Failure ]
-webkit.org/b/131793 fast/frames/frame-programmatic-noresize.html [ Failure Pass ]
-webkit.org/b/131794 fast/frames/frame-with-noresize-can-be-resized-after-removal-of-noresize.html [ Failure Pass ]
-webkit.org/b/131794 fast/frames/frame-with-noresize-can-be-resized-after-setting-noResize-to-false.html [ Failure Pass ]
 
 webkit.org/b/89663 editing/deleting/delete-3800834-fix.html [ Failure ]
 
index d8ce185..3594736 100644 (file)
@@ -1,9 +1,9 @@
-layer at (0,0) size 335x4018
-  RenderView at (0,0) size 335x585
-layer at (0,0) size 335x4018
-  RenderBlock {HTML} at (0,0) size 335x4018
-    RenderBody {BODY} at (8,8) size 319x4002
-      RenderBlock {DIV} at (-683,0) size 1002x4002 [border: (1px solid #FF0000)]
-        RenderText {#text} at (-491,1) size 1492x19
+layer at (0,0) size 235x4018
+  RenderView at (0,0) size 235x585
+layer at (0,0) size 235x4018
+  RenderBlock {HTML} at (0,0) size 235x4018
+    RenderBody {BODY} at (8,8) size 219x4002
+      RenderBlock {DIV} at (-783,0) size 1002x4002 [border: (1px solid #FF0000)]
+        RenderText {#text} at (-491,1) size 1492x17
           text run at (-491,1) width 1492: "BEGINddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddEND"
 scrolled to -716,0
index 5ca4197..1361fc9 100644 (file)
@@ -1,3 +1,28 @@
+2014-06-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
+
+        [GTK] Fix the handling of resize events after r169505.
+        https://bugs.webkit.org/show_bug.cgi?id=133517
+
+        Reviewed by Martin Robinson.
+
+        * Scripts/webkitpy/port/xvfbdriver.py:
+        (XvfbDriver._start): Set the resolution of Xvfb to XGA (1024x768).
+        The tests css3/viewport-percentage-lengths/viewport-percentage-lengths-*.html
+        need at least 900x640 pixels to pass.
+        * Scripts/webkitpy/port/xvfbdriver_unittest.py:
+        (XvfbDriverTest.test_start_no_pixel_tests): Update resolution.
+        (XvfbDriverTest.test_start_pixel_tests): Update resolution.
+        (XvfbDriverTest.test_start_arbitrary_worker_number): Update resolution.
+        (XvfbDriverTest.test_start_next_worker): Update resolution.
+        * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
+        (WTR::PlatformWebView::PlatformWebView): gtk_widget_size_allocate should
+        be requested over the main widget instead of the window.
+        (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame like
+        the Mac port.
+        (WTR::PlatformWebView::windowFrame): Remove legacy ifdef for GTK2.
+        (WTR::PlatformWebView::setWindowFrame): Set the size and position
+        of the Window and the web view.
+
 2014-06-17  Matthew Mirman <mmirman@apple.com>
 
         Unreviewed. Added myself to list of contributors.
index c42bad3..abf9bbc 100644 (file)
@@ -84,7 +84,7 @@ class XvfbDriver(Driver):
         if llvmpipe_libgl_path:
             environment['LD_LIBRARY_PATH'] = '%s:%s' % (llvmpipe_libgl_path, os.environ.get('LD_LIBRARY_PATH', ''))
 
-        run_xvfb = ["Xvfb", ":%d" % display_id, "-screen",  "0", "800x600x%s" % self._xvfb_screen_depth(), "-nolisten", "tcp"]
+        run_xvfb = ["Xvfb", ":%d" % display_id, "-screen",  "0", "1024x768x%s" % self._xvfb_screen_depth(), "-nolisten", "tcp"]
         with open(os.devnull, 'w') as devnull:
             self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull)
 
index e1cfa79..e1058e2 100644 (file)
@@ -67,19 +67,19 @@ class XvfbDriverTest(unittest.TestCase):
 
     def test_start_no_pixel_tests(self):
         driver = self.make_driver()
-        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
+        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0")
         self.cleanup_driver(driver)
 
     def test_start_pixel_tests(self):
         driver = self.make_driver()
-        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
+        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
         self.cleanup_driver(driver)
 
     def test_start_arbitrary_worker_number(self):
         driver = self.make_driver(worker_number=17)
-        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
+        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
         self.cleanup_driver(driver)
 
@@ -108,12 +108,12 @@ class XvfbDriverTest(unittest.TestCase):
     def test_start_next_worker(self):
         driver = self.make_driver()
         driver._next_free_display = lambda: 0
-        expected_logs = "MOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
+        expected_logs = "MOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
         self.cleanup_driver(driver)
         driver = self.make_driver()
         driver._next_free_display = lambda: 3
-        expected_logs = "MOCK popen: ['Xvfb', ':3', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
+        expected_logs = "MOCK popen: ['Xvfb', ':3', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']\n"
         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":3", pixel_tests=True)
         self.cleanup_driver(driver)
 
index 714ec65..6b16772 100644 (file)
@@ -43,7 +43,7 @@ PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup,
     gtk_container_add(GTK_CONTAINER(m_window), GTK_WIDGET(m_view));
 
     GtkAllocation size = { 0, 0, 800, 600 };
-    gtk_widget_size_allocate(m_window, &size);
+    gtk_widget_size_allocate(GTK_WIDGET(m_view), &size);
     gtk_window_resize(GTK_WINDOW(m_window), 800, 600);
     gtk_widget_show_all(m_window);
 
@@ -58,14 +58,10 @@ PlatformWebView::~PlatformWebView()
 
 void PlatformWebView::resizeTo(unsigned width, unsigned height)
 {
-    // FIXME: Don't we need to resize the window too?
-
-    GtkAllocation size = { 0, 0, static_cast<int>(width), static_cast<int>(height) };
-    gtk_widget_size_allocate(m_window, &size);
-    gtk_window_resize(GTK_WINDOW(m_window), width, height);
-
-    while (gtk_events_pending())
-        gtk_main_iteration();
+    WKRect frame = windowFrame();
+    frame.size.width = width;
+    frame.size.height = height;
+    setWindowFrame(frame);
 }
 
 WKPageRef PlatformWebView::page()
@@ -82,14 +78,8 @@ void PlatformWebView::focus()
 WKRect PlatformWebView::windowFrame()
 {
     GtkAllocation geometry;
-#ifdef GTK_API_VERSION_2
-    gint depth;
-    gdk_window_get_geometry(gtk_widget_get_window(GTK_WIDGET(m_window)),
-                            &geometry.x, &geometry.y, &geometry.width, &geometry.height, &depth);
-#else
     gdk_window_get_geometry(gtk_widget_get_window(GTK_WIDGET(m_window)),
                             &geometry.x, &geometry.y, &geometry.width, &geometry.height);
-#endif
 
     WKRect frame;
     frame.origin.x = geometry.x;
@@ -101,8 +91,13 @@ WKRect PlatformWebView::windowFrame()
 
 void PlatformWebView::setWindowFrame(WKRect frame)
 {
-    gtk_window_move(GTK_WINDOW(m_window), frame.origin.x, frame.origin.y);
-    resizeTo(frame.size.width, frame.size.height);
+    gdk_window_move_resize(gtk_widget_get_window(GTK_WIDGET(m_window)),
+        frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
+    GtkAllocation size = { 0, 0, static_cast<int>(frame.size.width), static_cast<int>(frame.size.height) };
+    gtk_widget_size_allocate(GTK_WIDGET(m_view), &size);
+
+    while (gtk_events_pending())
+        gtk_main_iteration();
 }
 
 void PlatformWebView::addChromeInputField()