Closed Bug 2011471 Opened 2 months ago Closed 1 month ago

Simplify logic for commands manipulating the window states, size and position

Categories

(Remote Protocol :: Marionette, enhancement, P3)

enhancement
Points:
3

Tracking

(firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m19])

Attachments

(2 files)

Towards my work on bug 1855028 it would be great to simplify the current code for Marionette and move some of the extra logic that we need as well for WebDriver BiDi into the WindowManager. Also all of these commands can directly return the new window rect that is needed anyway and saves an extra call from the GeckoDriver.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Depends on: 2012132
See Also: → 2012132
Points: --- → 3
Priority: -- → P3
Whiteboard: [webdriver:m19]
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cffcc7b999f7 https://hg.mozilla.org/integration/autoland/rev/52dd7c6f5019 [marionette] Simplify logic for commands manipulating the window states, size and position. r=Sasha
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6360cc4ed94f https://hg.mozilla.org/integration/autoland/rev/4726ad3b8dab Revert "Bug 2011471 - [marionette] Simplify logic for commands manipulating the window states, size and position. r=Sasha" for causing remote failures @ browser_WindowManager.js

The last try build that I did was all fine and since then I didn't change this test:
https://treeherder.mozilla.org/jobs?repo=try&revision=561f50931bce02beae9664332fe0b7aa74d09dc6

I need to take a closer look tomorrow.

There are clearly some strange things that I do not see locally:

  • When using float values for the position and size of the window the resizing works fine but the positioning is off. Instead of moving the window to (400,200) it moves it to (320,123) which is for both x and y roughly a difference of ~80px. I cannot reproduce this one locally.

  • For the test test_adjustWindowGeometry_minimumDimensions we first try to get the minimum dimensions of the window by resizing it to 50x50, restoring the original size right after, and then resizing the window to (100,100) [here we should probably size to that specific dimension]. The window is now not resized to the minimum dimension but stays large:

[task 2026-02-03T18:25:06.625+00:00] 18:25:06     INFO - GECKO(7931) | 1770143106624	RemoteAgent	TRACE	Setting window geometry to 50x50 @ (null, null)
[task 2026-02-03T18:25:06.626+00:00] 18:25:06     INFO - GECKO(7931) | 1770143106624	RemoteAgent	TRACE	Checking window geometry 1280x1077 @ (66, 32)
[task 2026-02-03T18:25:06.700+00:00] 18:25:06     INFO - GECKO(7931) | 1770143106699	RemoteAgent	TRACE	Received DOM event resize for [object Window]
[task 2026-02-03T18:25:06.700+00:00] 18:25:06     INFO - GECKO(7931) | 1770143106699	RemoteAgent	TRACE	Checking window geometry 500x157 @ (66, 32)
[task 2026-02-03T18:25:07.139+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107137	RemoteAgent	TRACE	Setting window geometry to 1280x1077 @ (66, 32)
[task 2026-02-03T18:25:07.139+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107137	RemoteAgent	TRACE	Checking window geometry 500x157 @ (66, 32)
[task 2026-02-03T18:25:07.141+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107140	RemoteAgent	TRACE	Received DOM event MozUpdateWindowPos for [object WindowRoot]
[task 2026-02-03T18:25:07.141+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107140	RemoteAgent	TRACE	Checking window geometry 1280x1077 @ (66, 32)
[task 2026-02-03T18:25:07.142+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107140	RemoteAgent	TRACE	Requested window geometry matches
[task 2026-02-03T18:25:07.145+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107144	RemoteAgent	TRACE	Setting window geometry to 100x100 @ (null, null)
[task 2026-02-03T18:25:07.145+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107144	RemoteAgent	TRACE	Checking window geometry 1280x1077 @ (66, 32)
[task 2026-02-03T18:25:07.188+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107187	RemoteAgent	TRACE	Received DOM event resize for [object Window]
[task 2026-02-03T18:25:07.189+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107187	RemoteAgent	TRACE	Checking window geometry 1280x1077 @ (66, 32)
[task 2026-02-03T18:25:07.189+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107187	RemoteAgent	TRACE	Already found a previous match for this request
[task 2026-02-03T18:25:07.190+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107187	RemoteAgent	TRACE	Received DOM event resize for [object Window]
[task 2026-02-03T18:25:07.191+00:00] 18:25:07     INFO - GECKO(7931) | 1770143107187	RemoteAgent	TRACE	Checking window geometry 1280x1077 @ (66, 32)

We seem to exit too early because the window didn't resize (we hit a previous match). Emilio or Martin, would you have an explanation for that?

Flags: needinfo?(stransky)
Flags: needinfo?(hskupin)
Flags: needinfo?(emilio)

Could you take logs with MOZ_LOG=Widget:5 or so? That should provide the necessary context on what's going on on the widget side. Otherwise, not sure really, without being able to reproduce.

The "Already found a previous match for this request" is irrelevant, right? That's probably for the previous request.

Flags: needinfo?(emilio)

Emilio pointed out that https://phabricator.services.mozilla.com/D280363 didn't land yet and I may have pushed my patches by having this patch applied. So it would make sense given that the tests that are failing are modifying both the size and position.

As such I pushed a try build and it indeed fixes it:

Flags: needinfo?(stransky)

Now that bug 2012132 is fixed it looks all good. Lets finally land the patch on this bug.

Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2eef543b362c https://hg.mozilla.org/integration/autoland/rev/f8d5e83c9394 [marionette] Simplify logic for commands manipulating the window states, size and position. r=Sasha
See Also: → 1946389
Blocks: 1946389
See Also: 1946389
Pushed by csabou@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c857660dacc3 https://hg.mozilla.org/integration/autoland/rev/9b3217742fe7 [remote] Remove unnecessary window position checks in test_adjustWindowGeometry_minimumDimensions.
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Blocks: 1987194
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: