Use l10n cache for strings in the urlbar view
Categories
(Firefox :: Address Bar, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: adw, Assigned: lesore0789, Mentored)
References
Details
Attachments
(5 files)
While working on the Firefox Suggest label pop-in/flicker problem in bug 1725289, I noticed that our other l10n strings in the view pop in too. Their pop-in is harder to spot because unlike the Firefox Suggest label, they don't cause the view to get taller or shift any results when they pop in. Even so, it still contributes to an overall feeling of flicker and instability in the view IMO, and ideally it wouldn't happen.
I'll attach some screenshots that show the problem.
It should be straightforward to use the string caching mechanism added in that bug for all l10n strings in the view.
Reporter | ||
Comment 1•3 years ago
|
||
The search heuristic is still showing the Visit string after I typed "ded". A split second later it changes to Search with Google.
Reporter | ||
Comment 2•3 years ago
|
||
The tab-to-search result is missing its title. A split second later "Search with DuckDuckGo --" pops in.
Reporter | ||
Comment 3•3 years ago
•
|
||
Amazon and eBay are both sponsored results. Amazon's action text is still the search heuristic action, and eBay's is missing. A split second later, "Sponsored" pops in for both results.
Reporter | ||
Comment 4•3 years ago
|
||
The visit heuristic action is still Sponsored, after showing Amazon and eBay from the previous screenshot and then typing "d". A split second later it changes to Visit.
Reporter | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Drew, I wonder if you'd be interested in mentoring this?
Reporter | ||
Comment 6•3 years ago
|
||
Yes, but I'd like to fix this sooner rather than later, so I might end up taking it.
Hi Drew, my name is Leslie and I am an Outreachy applicant. I would like to work on this bug. Can I be assigned to it?
Hi Drew, I just wanted to follow up on this bug. I'd like to work on it, but I have questions regarding where to start. What files should I be working on?
Reporter | ||
Comment 9•3 years ago
|
||
Hi Leslie, basically the idea is to update UrlbarView to replace all this.document.l10n.setAttributes
calls with calls to this._setElementL10n
. There are already to calls to _setElementL10n
in that file, so you can look at those for examples on how to call it.
Some of those calls have corresponding calls to element.removeAttribute("data-l10n-id")
when the UI label needs to be removed, and those removeAttribute
calls need to be updated to this._removeElementL10n
.
Before you can use cached strings with _setElementL10n
, you'll first need to cache them by adding them to _cacheL10nStrings
.
This document on Fluent might be helpful to look at to understand what's going on with these calls, at least the first half, not so much the second half.
Assignee | ||
Comment 10•3 years ago
|
||
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b28a6727c326 Use l10n cache for strings in the urlbar view. r=adw
Comment 12•3 years ago
|
||
bugherder |
Description
•