Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Commit

Permalink
Polyfill template element in l10n.js for Firefox OS 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss committed Jul 2, 2015
1 parent a645aa0 commit 1d5aa09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/lib/l10n.js
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,15 @@
// `element` but such that `element`'s own children are not replaced
var translation = element.ownerDocument.createElement('template');
translation.innerHTML = value;
// polyfill html5 template element for Firefox OS 1.1 (added by Firetext)
if (!('content' in translation)) {
translation.content = element.ownerDocument.createDocumentFragment();
var childElement;
while ((childElement = translation.childNodes[0])) {
translation.removeChild(childElement);
translation.content.appendChild(childElement);
}
}
// overlay the node with the DocumentFragment
overlayElement(element, translation.content);
}
Expand Down

0 comments on commit 1d5aa09

Please sign in to comment.