Remove all uses of innerHTML in localizable content

RESOLVED FIXED

Status

Firefox OS
Gaia::L10n
P4
normal
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: stas, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 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

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

Updated

3 years ago
Depends on: 1191163
Created attachment 8652056 [details] [review]
[gaia] zbraniecki:1027117-remove-innerHTML-from-l10n > mozilla-b2g:master
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

3 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: 3 years ago
Resolution: --- → FIXED
Duplicate of this bug: 1192876
(Reporter)

Comment 7

2 years ago
This needs to land in l20n.js v2.x.
(Reporter)

Comment 8

2 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.