If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

MousePosTracker flushes layout on mouse move

RESOLVED DUPLICATE of bug 1307134

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 1307134
6 months ago
6 months ago

People

(Reporter: florian, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 months ago
See this profile: https://perfht.ml/2ptk7YJ
(This is on a low powered old netbook)

Several things could be improved here:

- This code is what causes the layout flushes, could we get the same result using something that doesn't flush?
http://searchfox.org/mozilla-central/rev/624d25b2980cf5f83452b040e6d664460f9b7ec5/browser/base/content/browser.js#8226
    this._x = event.screenX / fullZoom - window.mozInnerScreenX;
    this._y = event.screenY / fullZoom - window.mozInnerScreenY;

- We add the mousemove and dragover event listeners unconditionally in _delayedStartup at http://searchfox.org/mozilla-central/rev/624d25b2980cf5f83452b040e6d664460f9b7ec5/browser/base/content/browser.js#1531 but this code won't actually be of any use unless MousePosTracker.addListener has been called at least once.
We have only 2 places in our code that add these listeners: it's only when we are in full screen mode, or when the statusbar panel is displayed (ie. when hovering a link).
We should instead add the mousemove and dragover event listeners in MousePosTracker.addListener, and remove them in MousePosTracker.removeListener if the Set of listeners becomes empty.

- We should replace "this._listeners.forEach(function(listener) {" with "for let listener of this._listeners {" to reduce overhead.

Comment 1

6 months ago
duplicate of bug 1307134?
(Reporter)

Comment 2

6 months ago
(In reply to Dão Gottwald [::dao] from comment #1)
> duplicate of bug 1307134?

Yes, although that bug is more confusing... but the last 3 comments there are useful so I'll dupe. Thanks!
No longer blocks: 1338595, 1348289
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → DUPLICATE
Whiteboard: [photon][qf]
Duplicate of bug: 1307134
You need to log in before you can comment on or make changes to this bug.