Whoops, forgot to edit WHATSNEW
[htmlpurifier/darkodev.git] / smoketests / innerHTML.js
blob74ccbb68896840c73412f72d564d29ceb5b27a66
1 var alphabet = 'a!`=[]\\;\':"/<> &';
3 var out = document.getElementById('out');
4 var testContainer = document.getElementById('testContainer');
6 function print(s) {
7 out.value += s + "\n";
10 function testImage() {
11 return testContainer.firstChild;
14 function test(input) {
15 var count = 0;
16 var oldInput, newInput;
17 testContainer.innerHTML = "<img />";
18 testImage().setAttribute("alt", input);
19 print("------");
20 print("Test input: " + input);
21 do {
22 oldInput = testImage().getAttribute("alt");
23 var intermediate = testContainer.innerHTML;
24 print("Render: " + intermediate);
25 testContainer.innerHTML = intermediate;
26 if (testImage() == null) {
27 print("Image disappeared...");
28 break;
30 newInput = testImage().getAttribute("alt");
31 print("New value: " + newInput);
32 count++;
33 } while (count < 5 && newInput != oldInput);
34 if (count == 5) {
35 print("Failed to achieve fixpoint");
37 testContainer.innerHTML = "";
40 print("Go!");
42 test("`` ");
43 test("'' ");
45 for (var i = 0; i < alphabet.length; i++) {
46 for (var j = 0; j < alphabet.length; j++) {
47 test(alphabet.charAt(i) + alphabet.charAt(j));
51 // document.getElementById('out').textContent = alphabet;