Bug 1884146 - Cross containers switch-tab artifacts remain on other address bar resul...
commitc0c7d510a496f804ba42703cd81cfc8011eb006b
authorMarco Bonardo <mak77@bonardo.net>
Fri, 15 Mar 2024 10:18:25 +0000 (15 10:18 +0000)
committerMarco Bonardo <mak77@bonardo.net>
Fri, 15 Mar 2024 10:18:25 +0000 (15 10:18 +0000)
tree7155f42892c8e61834ee34020400fc605c2250cc
parent5d26ad6dce70b58e2cfe7453e73b999f9f43f8e7
Bug 1884146 - Cross containers switch-tab artifacts remain on other address bar results. r=jteow

The heuristic result is always kept first when receiving new results, that means
any result could be upgraded to be a heuristic result, including the first Top
Site, as in the zero prefix case there's no heuritic.
Thus it's safer to generate new DOM contents when upgrading between heuristic and
non-heuristic.

Also switch-tab results with container info have complex structure and should
generate new DOM contents, unless they are reused by other switch-tab results.

Unfortunately these changes are mostly visual and not easily testable, as it would
be very time consuming.

In general, for the long term, reusing the DOM of results is fragile and causes
nodes, attributes or classes to be ported over to incompatible results. We do it
to avoid flicker, but we must investigate better ways to do it.

Differential Revision: https://phabricator.services.mozilla.com/D204483
browser/components/urlbar/UrlbarView.sys.mjs