Closed Bug 2072918 Opened 2 months ago Closed 1 month ago

browser_customize_menu_content.js waits for a CSS transition to end rather than for the customize panel to open

Categories

(Firefox :: New Tab Page, task)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 2 open bugs)

Details

Attachments

(1 external file)

browser_customize_menu_content.js waits for the customize panel by polling getComputedStyle(".customize-menu").transform for the identity matrix, which only holds once the panel's 250 ms slide-in transition has finished. A transition needs paint, so in a job that cannot paint the panel is open -- beforetoggle has fired on the dialog, so showModal() ran -- with everything the test goes on to assert already true, while the transform stays at translateX(435px) until the poll expires.

That is its fail in the 21 days to 2026-09-15, one in 12,196 runs: all three tasks failed with Customize Menu should be visible on screen - timed out after 50 tries on linux2404-64/opt-mochitest-browser-chrome-trainhop-rel, task bPjgtnNwSbSTDkI3n2TAGw, whose per-test profile shows RefreshDriverTick waiting for paint every ~17 ms for the whole 5 s timeout. That job was broken tree-wide -- 10 newtab tests failed in it and it ended in a shutdown hang -- so the test was a bystander, but it was a bystander because it asserts on an animated value. (Its other issue, a timeout, is the waitForPreloaded cause in bug 2064559.)

The component states the same thing without the animation: the customize-animate-enter-done class, which react-transition-group applies on a setTimeout independent of paint, and the dialog's open property for the close checks. browser_customize_menu_render.js and browser_customize_menu_key_open.js already wait on enter-done.

Verified by forcing the condition rather than by rate: injecting .customize-menu { transition: transform 60s linear !important } before each open reproduces the signature 3/3, and with the patch and the same injection it passes 9/9. --verify 270 passed / 0 failed.

Three older bugs cover different signatures in this file: bug 1729987, bug 1687896 and bug 1947352.

All three tasks polled getComputedStyle(".customize-menu").transform for the
identity matrix, which only holds once the 250ms slide-in transition has run to
completion, and a CSS transition only advances while the refresh driver can
tick. In a job that cannot paint, the panel is open and its close button
focused while the transform never moves.

The customize-animate-enter-done class and the dialog's open property are set
by the component rather than by the animation, and enter-done is what the
sibling browser_customize_menu_render.js already waits on. The close checks get
stronger as well: the transform left the identity matrix as soon as the exit
transition started, whereas open goes false in the panel's onExited.

Assignee: nobody → florian
Status: NEW → ASSIGNED
See Also: → 2073419
Blocks: 2074031
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bbd85068caa2 https://hg.mozilla.org/integration/autoland/rev/eed027150d81 Wait for the customize panel's own open state rather than its slide-in transform in browser_customize_menu_content.js, r=mconley.
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: