Closed Bug 1838632 Opened 1 years ago Closed 1 years ago

Stop using non-standard attributes as a DTD migration legacy and lint for reoccurrences

Categories

(Firefox :: General, task, P1)

Desktop
All
task

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: Gijs, Assigned: Gijs)

References

Details

Attachments

(4 files)

bug 1838549 happened because the content used to be localized using DTDs (which were processed at HTML/XUL-parse time), and used JS to update labels dynamically based on the non-standard attributes. When migrating to fluent, this ended up inadvertently depending on l10n timing, because the attribute could be blank if fluent translation hadn't happened yet at the point where the JS ran.

This is a bad pattern, full stop - the JS should just switch to a different l10n ID. The pre-fix-in-bug1838549 code was not only racy, but also would not work well if the document was retranslated after a language update, because the "real" label would not have been updated until the JS re-ran.

I have a WIP patch that lints for non-standard attributes, and it's found a few other instances of this, plus some cases where we've accidentally used a non-meaningful attribute (e.g. "tooltip") when we intended to use a "real" one (like "tooltiptext"), so a linter seems like it'd be useful.

The Bugbug bot thinks this bug should belong to the 'Firefox::Migration' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Migration

Bad bugbot, no botsnacks for you.

Component: Migration → General
Severity: -- → N/A
Type: defect → task
Priority: -- → P1
Status: NEW → ASSIGNED
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/2d8cda133356 make fluent-lint complain about unknown attributes, r=flod,fluent-reviewers https://hg.mozilla.org/integration/autoland/rev/153a0ea81f77 fix connection dialog autologin checkbox to have a tooltip as intended, r=fluent-reviewers,flod,mconley https://hg.mozilla.org/integration/autoland/rev/547458ae6707 fix edit bookmarks dialog's use of non-standard fluent attributes to use more straightforward switches between messages, r=jsudiaman,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/e7e1efea4e06 comment and/or adjust some devtools uses of non-standard attributes in fluent, r=devtools-reviewers,fluent-reviewers,nchevobbe,flod
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: