Bug 1630681 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

As part of rendering the autocomplete popup in the Password Manager on username or password fields, the width of the popup is set based on the width of the corresponding input field in the page or a specified minimum width.

Currently, the desired width is obtained by [calling `getBoundingClientRect` on an ancestor node and then setting the `style.width` on the target node](https://searchfox.org/mozilla-central/rev/a707541ff423ade0d81cef6488e6ecfa09273886/toolkit/content/widgets/autocomplete-richlistitem.js#656-660). This forces a synchronous layout flush taking on the order of 10ms that can likely be avoided, since we already have at least the input field's width from the content process stored in an attribute on another ancestor node.

There may be some display issues to resolve with reading the attribute instead in certain situations like when the input field on the page is using a default width, but hopefully those can be addressed, as this would reduce the time it takes to display the autocomplete popup  (Bug 1619498) by a little more than 20% (at least on my machine).
As part of rendering the autocomplete popup in the Password Manager on username or password fields, the width of the popup is set based on the width of the corresponding input field in the page or a specified minimum width.

Currently, the desired width is obtained by [calling `getBoundingClientRect` on an ancestor node and then setting the `style.width` on the target node](https://searchfox.org/mozilla-central/rev/a707541ff423ade0d81cef6488e6ecfa09273886/toolkit/content/widgets/autocomplete-richlistitem.js#656-660). This forces [a synchronous layout flush taking on the order of 10ms](https://perfht.ml/3eokTAr) that can likely be avoided, since we already have at least the input field's width from the content process stored in an attribute on another ancestor node.

There may be some display issues to resolve with reading the attribute instead in certain situations like when the input field on the page is using a default width, but hopefully those can be addressed, as this would reduce the time it takes to display the autocomplete popup  (Bug 1619498) by a little more than 20% (at least on my machine).

Back to Bug 1630681 Comment 0