Links in the "Language and Appearance" sub-section of about:preferences don't work as expected
Categories
(Firefox :: Settings UI, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox120 | --- | wontfix |
firefox121 | --- | wontfix |
firefox122 | --- | verified |
firefox123 | --- | verified |
People
(Reporter: hjones, Assigned: hjones)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
The "Manage colors" and "Extensions & Themes" links in the "Language and Appearance" section of about:preferences#general either no longer work or link to the wrong place. The "Manage colors" link doesn't link to anything, and the "Extensions & Themes" link goes to about:addons, but doesn't link directly to the "Themes" section. It also always opens a new tab when previously it would just switch the tab if about:addons was already open.
Digging into this a bit, it looks like these listeners are getting removed when Fluent runs, which would explain the unexpected behaviour and make sense in the context of the regressing bug. Before that change, we were waiting for Fluent to run on the relevant fragment before adding the event listeners. The issue can be fixed by changing the code to something like this:
// make the AppearanceChooser init async and wait for pending Fluent mutations before adding listeners
async init() {
...
if (document.hasPendingL10nMutations) {
await new Promise(r =>
document.addEventListener("L10nMutationsFinished", r, { once: true })
);
}
// Add event listeners here
...
}
It looks like adding event listeners to DOM elements nested in translations is a known limitation of Fluent, so I'm not sure if there's a different way we might want to address this (like by moving the listeners off of the nested elements).
Comment 1•1 year ago
|
||
(In reply to Hanna Jones [:hjones] from comment #0)
Nice find and thanks for filing!
It looks like adding event listeners to DOM elements nested in translations is a known limitation of Fluent, so I'm not sure if there's a different way we might want to address this (like by moving the listeners off of the nested elements).
Yes, that last thing. Otherwise, if the browser language changes at runtime, the listeners also stop working. In principle, the calling code should not need to care about the timing of the l10n bits, and accept that it cannot attach listeners directly to these elements - and/or we should fix this as a bug in fluent-DOM (ie make it keep the existing DOM references instead of replacing them, which is why the listeners are going away). I'm fairly sure it's on file but I cannot find it right now. :-(
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1831259
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
This patch moves the event click event listeners off of the nested DOM elements to a common ancestor.
I was looking around but didn't see related tests - happy to add coverage here or as part of a follow up bug.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Set release status flags based on info from the regressing bug 1831259
Updated•1 year ago
|
Comment 6•1 year ago
|
||
bugherder |
Comment 7•1 year ago
|
||
The patch landed in nightly and beta is affected.
:hjones, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox122
towontfix
.
For more information, please visit BugBot documentation.
Comment 8•1 year ago
|
||
This patch moves the event click event listeners off of the nested DOM elements to a common ancestor.
I was looking around but didn't see related tests - happy to add coverage here or as part of a follow up bug.
Original Revision: https://phabricator.services.mozilla.com/D196343
Updated•1 year ago
|
Comment 9•1 year ago
|
||
Uplift Approval Request
- Code covered by automated testing: no
- Risk associated with taking this patch: Low
- Needs manual QE test: yes
- String changes made/needed: No
- User impact if declined: Broken links in the Firefox settings
- Fix verified in Nightly: no
- Explanation of risk level: Very small patch that can only affect the settings page, JS only,
- Steps to reproduce for manual QE testing: See comment 0
- Is Android affected?: no
Updated•1 year ago
|
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Reproduced the initial issue described in comment 0 using an old affected Nightly build from (2023-12-12), verified that using the latest Nightly build from today (2023-12-28), both "Manage colors" and "Extensions & Themes" links point to the correct place, manage colors menu and about:addons (Themes section).
Updated•1 year ago
|
Updated•1 year ago
|
Comment 11•1 year ago
|
||
uplift |
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Also verified as fixed using latest Beta build 122.0b6 across platforms (Windows 11, macOS 13 and Ubuntu 22.04).
Description
•