Closed Bug 1815769 Opened 2 years ago Closed 2 years ago

Refactor code that reverts the Urlbar from PopupNotifications

Categories

(Toolkit Graveyard :: Notifications and Alerts, task)

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: jteow, Assigned: jteow)

References

Details

Attachments

(1 file)

As an interim fix and with :gijs' approval, we're going to revert the Urlbar from the context of PopupNotifications so that when a popup is about to show, it can ensure that the icons it needs show up even if search terms persist on a SERP.

However, as a long term solution, we should remove the hard coded reference to the Urlbar and Browser and instead additional dependency injection, specifically to allow consumers the ability to detect when a show event is happen before the popup appears. The issue is that the Urlbar only knows about the event after _showPanel tries to find is the anchor element is null or hidden, which will cause jank since the popup can initially show up in the wrong location.

From a chat with :Gijs

creating some kind of dependency injection with an observer notification or adding an option where the consumer provides a callback (which means you get to update all the consumers so that's not a lot of fun)
(maybe for doing the dep injection, having the consumer provide a function that returns a DOM element to use as anchor would help remove some of the strong coupling and not be too ugly)
(also, we could make the anchor visibility checks use non-flushing APIs to check if the anchor is visible, that'd be nice...)

See Also: → 1812232
Blocks: 1815971
Assignee: nobody → jteow
Attachment #9317642 - Attachment description: WIP: - Bug 1815769 - Create an event that's fired just prior to when a PopupNotification is shown - r?gijs,adw → Bug 1815769 - Add optional anchor lookup to PopupNotifications - r?gijs,adw
Status: NEW → ASSIGNED
Pushed by jteow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92cb203fac53 Add optional anchor lookup to PopupNotifications - r=Gijs,adw
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: