WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
180398
WebDriver: implement maximize, minimize and fullscreen window commands
https://bugs.webkit.org/show_bug.cgi?id=180398
Summary
WebDriver: implement maximize, minimize and fullscreen window commands
Carlos Garcia Campos
Reported
2017-12-05 01:53:42 PST
https://w3c.github.io/webdriver/webdriver-spec.html#maximize-window
https://w3c.github.io/webdriver/webdriver-spec.html#minimize-window
https://w3c.github.io/webdriver/webdriver-spec.html#fullscreen-window
Attachments
Patch
(35.37 KB, patch)
2018-05-17 04:44 PDT
,
Carlos Garcia Campos
no flags
Details
Formatted Diff
Diff
Try to fix iOS builds
(35.36 KB, patch)
2018-05-21 22:49 PDT
,
Carlos Garcia Campos
bburg
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2018-05-17 04:44:20 PDT
Created
attachment 340572
[details]
Patch
EWS Watchlist
Comment 2
2018-05-17 04:46:39 PDT
Attachment 340572
[details]
did not pass style-queue: ERROR: Source/WebDriver/Session.h:93: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.h:94: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.h:95: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.cpp:974: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.cpp:982: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.cpp:990: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.h:82: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.h:83: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.h:84: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:777: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:802: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:827: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 12 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Carlos Garcia Campos
Comment 3
2018-05-17 05:30:45 PDT
EWS failure seems to be an icecc issue. ICECC[11888] 04:48:37: flush_writebuf() failed Broken pipe ICECC[11888] 04:48:37: no server found behind given hostname 127.0.0.1:0 ICECC[11888] 04:48:37: got exception Error 2 - no server found at 127.0.0.1 (127.0.0.1) [4727/5056] Building CXX object Source/WebKit/CMakeFiles/WebKit.dir/UIProcess/API/glib/WebKitWebContext.cpp.o ICECC[11820] 04:48:36: got exception Error 14 - error reading message from remote (192.168.10.107) ninja: build stopped: subcommand failed.
Carlos Garcia Campos
Comment 4
2018-05-21 22:49:59 PDT
Created
attachment 340956
[details]
Try to fix iOS builds
EWS Watchlist
Comment 5
2018-05-21 22:51:56 PDT
Attachment 340956
[details]
did not pass style-queue: ERROR: Source/WebDriver/Session.h:93: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.h:94: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.h:95: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.cpp:974: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.cpp:982: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.cpp:990: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.h:82: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.h:83: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/WebDriverService.h:84: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:777: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:802: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:827: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 12 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Blaze Burg
Comment 6
2018-05-22 13:18:52 PDT
Comment on
attachment 340956
[details]
Try to fix iOS builds View in context:
https://bugs.webkit.org/attachment.cgi?id=340956&action=review
r=me except GObject parts in WebKitWebViewGTK.cpp, which I do not understand.
> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:118 > + completeTimer.startOneShot(1_s);
Seems like a good idea, though I've never had it flake out on macOS yet.
> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:190 > +#if ENABLE(DEVELOPER_MODE)
Why is this part guarded?
> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:196 > + gtk_window_move(window, screenRect.x(), screenRect.y());
Should this be (0,0), or are the coordinates flipped somehow?
Carlos Garcia Campos
Comment 7
2018-05-23 06:31:51 PDT
Comment on
attachment 340956
[details]
Try to fix iOS builds View in context:
https://bugs.webkit.org/attachment.cgi?id=340956&action=review
>> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:118 >> + completeTimer.startOneShot(1_s); > > Seems like a good idea, though I've never had it flake out on macOS yet.
I think it's in the spec, but it doesn't say how long the timer should be, IIRC
>> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:190 >> +#if ENABLE(DEVELOPER_MODE) > > Why is this part guarded?
Because this code is only for the tests, it's a workaround for Xvfb, and tests are only built when developer mode is enabled.
>> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:196 >> + gtk_window_move(window, screenRect.x(), screenRect.y()); > > Should this be (0,0), or are the coordinates flipped somehow?
screenAvailableRect takes into account if there's a top panel at 0,0 for example.
Michael Catanzaro
Comment 8
2018-05-23 08:10:28 PDT
Comment on
attachment 340956
[details]
Try to fix iOS builds View in context:
https://bugs.webkit.org/attachment.cgi?id=340956&action=review
The bottom portions of webkitWebViewMaximizeWindow and webkitWebViewRestoreWindow feel pretty crowded, I would add some more blank lines in there.
> Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp:117 > + void requestMaximizeWindowOfPage(WebAutomationSession&, WebPageProxy& page, CompletionHandler<void()>&& completionHandler) override > + { > + auto* webView = webkitWebContextGetWebViewForPage(m_session->priv->webContext, &page); > + if (!webView) > + completionHandler(); > + webkitWebViewMaximizeWindow(webView, WTFMove(completionHandler)); > + } > + > + void requestHideWindowOfPage(WebAutomationSession&, WebPageProxy& page, CompletionHandler<void()>&& completionHandler) override > + { > + auto* webView = webkitWebContextGetWebViewForPage(m_session->priv->webContext, &page); > + if (!webView) > + completionHandler(); > + webkitWebViewMinimizeWindow(webView, WTFMove(completionHandler)); > + } > + > + void requestRestoreWindowOfPage(WebAutomationSession&, WebPageProxy& page, CompletionHandler<void()>&& completionHandler) override > + { > + auto* webView = webkitWebContextGetWebViewForPage(m_session->priv->webContext, &page); > + if (!webView) > + completionHandler(); > + webkitWebViewRestoreWindow(webView, WTFMove(completionHandler)); > + }
These all look wrong to me, shouldn't it be something like: if (auto* webView = webkitWebContextGetWebViewForPage(m_session->priv->webContext, &page)) webkitWebViewMaximizeWindow(webView, WTFMove(completionHandler)); else completionHandler(); Otherwise you're calling WebKitWebView methods with a NULL webview, and the completion handler could be called twice. r=me on the rest of the GTK bits.
> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:117 > + // Complete the event if not done after 1 second.
Nit: "one second."
> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:134 > + Type type; > + CompletionHandler<void()> completionHandler; > + RunLoop::Timer<WindowStateEvent> completeTimer;
How about some m_ for these?
Carlos Garcia Campos
Comment 9
2018-05-23 08:21:57 PDT
Comment on
attachment 340956
[details]
Try to fix iOS builds View in context:
https://bugs.webkit.org/attachment.cgi?id=340956&action=review
>> Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp:117 >> + } > > These all look wrong to me, shouldn't it be something like: > > if (auto* webView = webkitWebContextGetWebViewForPage(m_session->priv->webContext, &page)) > webkitWebViewMaximizeWindow(webView, WTFMove(completionHandler)); > else > completionHandler(); > > Otherwise you're calling WebKitWebView methods with a NULL webview, and the completion handler could be called twice. > > r=me on the rest of the GTK bits.
Oops, you are right, there's a missing return in all those cases after completionHandler(); I'll better use your proposal
>> Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp:134 >> + RunLoop::Timer<WindowStateEvent> completeTimer; > > How about some m_ for these?
This is a struct.
Carlos Garcia Campos
Comment 10
2018-05-24 01:54:46 PDT
Committed
r232150
: <
https://trac.webkit.org/changeset/232150
>
Radar WebKit Bug Importer
Comment 11
2018-05-24 01:55:22 PDT
<
rdar://problem/40514627
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug