Closed Bug 1690368 Opened 5 years ago Closed 5 years ago

updateFxaToolbarMenu touches the DOM between 2 style flushes

Categories

(Firefox :: Firefox Accounts, defect)

defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: florian, Assigned: florian)

Details

(Whiteboard: [fxperf])

Attachments

(1 file)

See this profile of opening a new window: https://share.firefox.dev/2MOfObn

Focusing the url bar triggers a sync style flush (see bug 1445811 for what we could do about it), then updateFxaToolbarMenu makes the DOM dirty by calling Element.setAttribute and then we flush styles again during the refresh driver tick.

Without knowing anything about what the FxA code is trying to do, it feels like swapping these 2 lines would save us a style flush: https://searchfox.org/mozilla-central/rev/b2433a832c250c55255e0ee37d05192d04f20427/browser/base/content/browser.js#1768,1770

Looking at the code actually setting an attribute (https://searchfox.org/mozilla-central/rev/b2433a832c250c55255e0ee37d05192d04f20427/browser/base/content/browser.js#699) I wonder if this attribute really needs to be set dynamically or if it could be in the initial markup of browser.xhtml.

Assignee: nobody → florian
Status: NEW → ASSIGNED
Pushed by fqueze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/280bdc634f73 call updateFxaToolbarMenu before focusing the urlbar causes a style flush, r=markh.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: