Remove all uses of innerHTML in localizable content

RESOLVED FIXED

Status

defect
P4
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: stas, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

5 years ago
When bug 994357 lands we will have a much better and secure alternative to explicitly setting innerHTML on translated elements.  This bug will track the removal of all innerHTML uses in translations.
Reporter

Updated

5 years ago
Blocks: 999779
Priority: -- → P4
SMS refactor landed last week, Settings is in review. It leaves System as the last big one to fix.
Depends on: 1171206, 1187668
Reporter

Updated

4 years ago
Depends on: 1191163
Comment on attachment 8652056 [details] [review]
[gaia] zbraniecki:1027117-remove-innerHTML-from-l10n > mozilla-b2g:master

We're *that* close to be done with .innerHTML.
Attachment #8652056 - Flags: review?(stas)
Depends on: 1196014
Reporter

Comment 4

4 years ago
Comment on attachment 8652056 [details] [review]
[gaia] zbraniecki:1027117-remove-innerHTML-from-l10n > mozilla-b2g:master

This looks great, thanks Zibi.

I wonder if this is the right moment to also fix the JS code which handled those <spans> in translations:  binding events to them, showing and hiding them etc.  We could add a single span to the source HTML and bind to it, since DOM overlays maintain the identity of elements.

What do you think?
Attachment #8652056 - Flags: review?(stas) → review+
Commit: https://github.com/mozilla-b2g/gaia/commit/60b924537fc116e5ff77712985571d70c7b37fb4
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Duplicate of this bug: 1192876
Reporter

Comment 7

4 years ago
This needs to land in l20n.js v2.x.
Reporter

Comment 8

4 years ago
(In reply to Staś Małolepszy :stas from comment #7)
> This needs to land in l20n.js v2.x.

https://github.com/l20n/l20n.js/commit/1057c621946e96db99ec1fcf4ebeebccf9a97108
You need to log in before you can comment on or make changes to this bug.