Closed
Bug 902363
Opened 11 years ago
Closed 11 years ago
mozL10n.localize() may clear an entire element instead of just the first text node
Categories
(Firefox OS Graveyard :: Gaia::L10n, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: kaze, Assigned: kaze)
References
Details
Attachments
(1 file)
Consider the following paragraph: <p id="test"> This is a test <button>foo</button> </p> This adds a `data-l10n-id="message"' attribute to #test and keeps the <button> element: mozL10n.localize(document.querySelector('#test'), 'message'); This should clear the `data-l10n-id="message"` attribute and the first text node: mozL10n.localize(document.querySelector('#test'), 'message'); but it also clears the <button> element, which is not expected.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → kaze
Assignee | ||
Comment 1•11 years ago
|
||
https://github.com/mozilla-b2g/gaia/pull/11397
Attachment #786830 -
Flags: review?(felash)
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Fabien Cazenave [:kaze] from comment #0) > This should clear the `data-l10n-id="message"` attribute and the first text > node: > > mozL10n.localize(document.querySelector('#test'), 'message'); > > but it also clears the <button> element, which is not expected. Gosh, I need some PTO. *This* should clear the l10n-id attribute and the first text node: > mozL10n.localize(document.querySelector('#test')); Sorry for the confusion (again).
Comment 3•11 years ago
|
||
Comment on attachment 786830 [details]
link to pull request
comments on github
please ask me for review again once it's ready :)
Attachment #786830 -
Flags: review?(felash)
Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 786830 [details]
link to pull request
Comments addressed.
Attachment #786830 -
Flags: review?(felash)
Comment 5•11 years ago
|
||
Comment on attachment 786830 [details]
link to pull request
r=me with the last comment (that you can decide to keep or not)
Attachment #786830 -
Flags: review?(felash) → review+
Assignee | ||
Comment 6•11 years ago
|
||
Merged on master: https://github.com/mozilla-b2g/gaia/commit/e5154bdd600179bccf1931d0775354cddb31cf43
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Component: Gaia → Gaia::L10n
You need to log in
before you can comment on or make changes to this bug.
Description
•