TabCenter icon indicating copy to clipboard operation
TabCenter copied to clipboard

<tab> element for selected tab rebuilt once per second

Open db48x opened this issue 8 years ago • 3 comments

Selecting a tab does need to change some attributes of the tab (visuallyselected=true, for one), so that's expected. However, I did not expect that ever attribute would be reset to the same value once per second. You can see it happening in the dom inspector.

db48x avatar Jan 13 '17 15:01 db48x

The reason this is happening once per second is to update the thumbnail of the active tab. It is preferable that all of the attributes do not need to be redrawn but I believe that was something that had to happen because of XUL.

ericawright avatar Jan 13 '17 15:01 ericawright

Ah, I see. Perhaps another optimization would be to skip it entirely if the thumbnails are hidden. :)

db48x avatar Jan 14 '17 04:01 db48x

Perhaps another optimization would be to skip it entirely if the thumbnails are hidden.

Looking at the current code, the thumbnail is not rebuilt when tabs are not in "large" mode. Maybe Erica or Blake fixed that already.

Another optimization would be to skip rebuilding the thumbnail (or even updating the label) for the New Tab. Proof of concept for the refreshThumbAndLabel method:

// don't rebuild the image or label for the New Tab
if (['about:newtab', 'about:blank'].includes(url) && url === this._prevUrl) return;
this._prevUrl = url;

fvsch avatar Feb 10 '17 11:02 fvsch