Closed Bug 1309564 Opened 8 years ago Closed 8 years ago

HTML and XUL bindings should only use html- and xul-namespaced traits

Categories

(L20n :: JS Library, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stas, Assigned: zbraniecki)

References

Details

(Whiteboard: [gecko-l20n])

Attachments

(1 file)

When translating DOM attributes, the bindings code should only use traits which are in the xul and the html namespaces.
Blocks: 1280669
It seems to be done now, can we close this bug?
Flags: needinfo?(stas)
Can you point to where it's done?  I don't think it is.  I'd expect this code to check if trait.key.namespace is 'xul' or 'html', but that would require it to know which element the translations is for:

  https://github.com/l20n/l20n.js/blob/69fe01ff11422ffd9a0e68d91eaffa6fa8e4c321/src/lib/format.js#L138

Or, we could format all traits with namespaces and store the namespaces on the result object, and then only apply those matching the current element's namespace in:

  https://github.com/l20n/l20n.js/blob/69fe01ff11422ffd9a0e68d91eaffa6fa8e4c321/src/bindings/overlay.js#L66
Flags: needinfo?(stas)
ah, I confused the overlay ATTRIBUTES_ALLOWED with this.

I think it would be cleaner to select it in bindings than in lib
Yeah, agree.  Want to give it a try?
yeah
Assignee: nobody → gandalf
Attached file pr
Attachment #8805506 - Flags: review?(stas)
Attachment #8805506 - Flags: review- → review?(stas)
Comment on attachment 8805506 [details]
pr

lgtm, thanks!
Attachment #8805506 - Flags: review?(stas) → review+
https://hg.mozilla.org/projects/larch/rev/8f9c827a11e3400c939cce7f609bb0454d6c00bb
Bug 1309564 - HTML and XUL bindings should only use html- and xul-namespaced traits. r=stas
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: