Expand on hover does a lot of unnecessary work
Categories
(Firefox :: Sidebar, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr128 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox141 | --- | unaffected |
| firefox142 | --- | fixed |
| firefox143 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
(Regressed 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [fidefe-sidebar])
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
Noticed when looking at the review comments of bug 1979548, but is unrelated / reproduces without that.
diff --git a/browser/components/sidebar/browser-sidebar.js b/browser/components/sidebar/browser-sidebar.js
index 15354d48fbeb..7c434d6e81e6 100644
--- a/browser/components/sidebar/browser-sidebar.js
+++ b/browser/components/sidebar/browser-sidebar.js
@@ -1086,6 +1086,8 @@ var SidebarController = {
},
async _animateSidebarMain() {
+ dump(`_animateSidebarMain()\n`);
+ dump(new Error().stack + "\n");
let tabbox = document.getElementById("tabbrowser-tabbox");
let animatingElements;
let expandOnHoverEnabled = document.documentElement.hasAttribute(
@@ -2180,6 +2182,8 @@ var SidebarController = {
},
onMouseLeave() {
+ dump(`onMouseLeave()\n`);
+ dump(new Error().stack + "\n");
this.mouseEnterTask.disarm();
const contentArea = document.getElementById("tabbrowser-tabbox");
this._box.toggleAttribute("sidebar-launcher-hovered", false);
@@ -2192,6 +2196,8 @@ var SidebarController = {
},
onMouseEnter() {
+ dump(`onMouseEnter()\n`);
+ dump(new Error().stack + "\n");
this.mouseEnterTask = new DeferredTask(
() => {
this.debouncedMouseEnter();
It seems that when the launcher is expanded, we try to animate / expand it again once every second roughly? That seems unnecessary if the launcher is already expanded. Looks like addListener will happily callListener(), reentering in the process:
...
_animateSidebarMain()
_animateSidebarMain@chrome://browser/content/sidebar/browser-sidebar.js:1090:10
debouncedMouseEnter@chrome://browser/content/sidebar/browser-sidebar.js:2179:12
onMouseEnter/this.mouseEnterTask<@chrome://browser/content/sidebar/browser-sidebar.js:2203:14
#runTask@resource://gre/modules/DeferredTask.sys.mjs:356:25
#timerCallback/<@resource://gre/modules/DeferredTask.sys.mjs:327:28
#timerCallback@resource://gre/modules/DeferredTask.sys.mjs:346:9
#startTimer/callback/<@resource://gre/modules/DeferredTask.sys.mjs:192:32
onMouseEnter()
onMouseEnter@chrome://browser/content/sidebar/browser-sidebar.js:2200:10
_callListener@chrome://browser/content/browser.js:4881:18
addListener@chrome://browser/content/browser.js:4841:10
_removeHoverStateBlocker@chrome://browser/content/sidebar/browser-sidebar.js:1410:23
_animateSidebarMain@chrome://browser/content/sidebar/browser-sidebar.js:1249:18
_animateSidebarMain()
_animateSidebarMain@chrome://browser/content/sidebar/browser-sidebar.js:1090:10
debouncedMouseEnter@chrome://browser/content/sidebar/browser-sidebar.js:2179:12
onMouseEnter/this.mouseEnterTask<@chrome://browser/content/sidebar/browser-sidebar.js:2203:14
#runTask@resource://gre/modules/DeferredTask.sys.mjs:356:25
#timerCallback/<@resource://gre/modules/DeferredTask.sys.mjs:327:28
#timerCallback@resource://gre/modules/DeferredTask.sys.mjs:346:9
#startTimer/callback/<@resource://gre/modules/DeferredTask.sys.mjs:192:32
onMouseEnter()
onMouseEnter@chrome://browser/content/sidebar/browser-sidebar.js:2200:10
_callListener@chrome://browser/content/browser.js:4881:18
addListener@chrome://browser/content/browser.js:4841:10
_removeHoverStateBlocker@chrome://browser/content/sidebar/browser-sidebar.js:1410:23
_animateSidebarMain@chrome://browser/content/sidebar/browser-sidebar.js:1249:18
_animateSidebarMain()
_animateSidebarMain@chrome://browser/content/sidebar/browser-sidebar.js:1090:10
debouncedMouseEnter@chrome://browser/content/sidebar/browser-sidebar.js:2179:12
onMouseEnter/this.mouseEnterTask<@chrome://browser/content/sidebar/browser-sidebar.js:2203:14
#runTask@resource://gre/modules/DeferredTask.sys.mjs:356:25
#timerCallback/<@resource://gre/modules/DeferredTask.sys.mjs:327:28
#timerCallback@resource://gre/modules/DeferredTask.sys.mjs:346:9
#startTimer/callback/<@resource://gre/modules/DeferredTask.sys.mjs:192:32
onMouseEnter()
onMouseEnter@chrome://browser/content/sidebar/browser-sidebar.js:2200:10
_callListener@chrome://browser/content/browser.js:4881:18
addListener@chrome://browser/content/browser.js:4841:10
_removeHoverStateBlocker@chrome://browser/content/sidebar/browser-sidebar.js:1410:23
_animateSidebarMain@chrome://browser/content/sidebar/browser-sidebar.js:1249:18
| Assignee | ||
Comment 1•1 year ago
|
||
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1957008
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
| bugherder | ||
Comment 5•1 year ago
|
||
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox142towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 6•1 year ago
|
||
(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #5)
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
Kelly wdyt?
Comment 7•1 year ago
|
||
Seems low risk, so I say go for it.
| Assignee | ||
Comment 8•1 year ago
|
||
Comment on attachment 9503655 [details]
Bug 1979940 - Avoid unnecessary work for expand-on-hover if already expanded / collapsed. r=kcochrane,#sidebar-reviewers
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Fixes performance regression with expanded sidebar.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Relatively simple fix
- String changes made/needed: none
- Is Android affected?: No
Comment 9•1 year ago
|
||
Comment on attachment 9503655 [details]
Bug 1979940 - Avoid unnecessary work for expand-on-hover if already expanded / collapsed. r=kcochrane,#sidebar-reviewers
Approved for 142.0b6
Updated•1 year ago
|
Comment 10•1 year ago
|
||
| uplift | ||
Description
•