Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Revert "Bug 994357 - Use DOM overlays for safely setting node content…
Browse files Browse the repository at this point in the history
…. r=gandalf"

This reverts commit 7716352.
  • Loading branch information
lightsofapollo committed Mar 30, 2015
1 parent 9e218bf commit e91b4f4
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 950 deletions.
21 changes: 7 additions & 14 deletions apps/sharedtest/test/unit/l10n/bindings/l10n_test.js
Expand Up @@ -96,7 +96,7 @@ suite('L10n bindings', function() {
var elem;

suiteSetup(function() {
elem = document.createElement('input');
elem = document.createElement('div');
elem.setAttribute('data-l10n-id', 'input');
});

Expand Down Expand Up @@ -211,7 +211,6 @@ suite('L10n bindings', function() {
var elem, frag, h1, h2;

suiteSetup(function() {
lang = 'lang2';
elem = document.createElement('div');
frag = document.createElement('div');
h1 = document.createElement('h1');
Expand All @@ -225,19 +224,13 @@ suite('L10n bindings', function() {
document.body.appendChild(frag);
});

suiteTeardown(function(done) {
suiteTeardown(function() {
document.body.removeChild(frag);
lang = 'lang1';
navigator.mozL10n.ctx.addEventListener('ready', function onReady() {
navigator.mozL10n.ctx.removeEventListener('ready', onReady);
done();
});
navigator.mozL10n.ctx.requestLocales(lang);
});

test('retranslation', function(done) {
navigator.mozL10n.ctx.addEventListener('ready', function onReady() {
navigator.mozL10n.ctx.removeEventListener('ready', onReady);
lang = 'lang2';
navigator.mozL10n.once(function() {
setTimeout(function() {
assert.equal(elem.textContent, 'Crop Lang2');
assert.equal(h1.textContent, 'Header 1 Lang2');
Expand All @@ -247,7 +240,7 @@ suite('L10n bindings', function() {
});
});

navigator.mozL10n.ctx.requestLocales(lang);
navigator.mozL10n.language.code = 'lang2';
});
});
});
Expand All @@ -257,8 +250,8 @@ suite('L10n bindings', function() {
var elem = document.createElement('div');
elem.setAttribute('data-l10n-id', 'bad');
navigator.mozL10n.translateFragment(elem);
assert.equal(elem.getAttribute('title'), 'alert(1)');
assert.equal(elem.getAttribute('onclick'), undefined);
assert.equal(elem.getAttribute('title', 'alert(1)'));
assert.equal(elem.getAttribute('onclick', undefined));
});
});

Expand Down
261 changes: 0 additions & 261 deletions apps/sharedtest/test/unit/l10n/bindings/overlay_test.js

This file was deleted.

0 comments on commit e91b4f4

Please sign in to comment.