3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
8 window.onload = function()
10 if (location.hash == "#2") {
11 document.body.innerHTML = "PASSED: Duplicate webkit-canvas styles removed without crash.";
12 if (window.testRunner)
13 testRunner.notifyDone();
16 location.hash = "#" + (parseInt(location.hash.slice(1)) + 1).toString();
20 iframe = document.body.appendChild(document.createElement('iframe'));
21 element1 = document.createElement('a');
22 iframe.contentDocument.body.appendChild(element1);
23 element1.style.setProperty('background', '-webkit-canvas(canvas)');
25 element2 = document.createElement('a');
26 iframe.contentDocument.body.appendChild(element2);
27 element2.style.setProperty('background', '-webkit-canvas(canvas)');
29 element1.textContent = element2.textContent = 1;
30 setTimeout(removeElements, 0);
34 function removeElements()
36 iframe.contentDocument.body.removeChild(element1);
37 document.adoptNode(element1);
39 iframe.contentDocument.body.removeChild(element2);
40 document.adoptNode(element2);
42 document.body.removeChild(iframe);
46 if (window.GCController)
47 window.GCController.collect();
52 setTimeout(finishTest, timeout);
57 document.body.appendChild(element1);
58 setTimeout(function () { location.reload() }, 0);