Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / loader / delete-inside-cancelTimer.html
blob1a740938e0877492f0c60cfb3b1fba294ef9a799
1 <script>
2 // This tests that we don't crash if a CachedResource load is cancelled due to the removal
3 // of its last client, and it is deleted during cancellation. See crbug.com/258419
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
10 var scripts = document.getElementsByTagName("script");
11 for(var i = 0; i < scripts.length; i++) {
12 scripts[i].parentNode.removeChild(scripts[i]);
15 function rsc() {
16 document.execCommand("SelectAll", false)
18 document.addEventListener("readystatechange", rsc, false);
20 var inSubtreeModified = false;
21 var subtreeModifiedFiredCount = 0;
22 function subtreeModified() {
23 if (subtreeModifiedFiredCount >= 20) {
24 if (window.testRunner)
25 testRunner.notifyDone();
26 return;
28 if (inSubtreeModified)
29 return;
30 subtreeModifiedFiredCount++;
31 inSubtreeModified = true;
33 document.execCommand("SelectAll", false)
34 window.getSelection().collapseToStart()
35 var targetElement = event.target;
36 if (targetElement.tagName != 'animateTransform')
37 targetElement.insertAdjacentText('afterbegin', '%')
38 var clonedNode = document.getElementsByTagName("*")[2].cloneNode(false);
39 try {
40 targetElement.insertAdjacentElement('afterend', clonedNode)
41 } catch(e) {
43 inSubtreeModified = false;
45 document.addEventListener("DOMSubtreeModified", subtreeModified, true);
47 function load() {
48 var targetElement = event.target;
49 targetElement.insertAdjacentElement('afterend', document.createElementNS('http://www.w3.org/2000/svg', 'animateTransform'));
50 targetElement.parentNode.removeChild(targetElement)
51 targetElement.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'animateTransform'));
53 var all = document.getElementsByTagName("*");
54 all[70 % all.length].appendChild(targetElement)
55 targetElement.parentNode.removeChild(targetElement)
57 targetElement = document.importNode(targetElement, true)
58 var all = document.getElementsByTagName("*");
59 all[32 % all.length].appendChild(targetElement)
60 targetElement.insertAdjacentElement('beforeend', document.createElementNS('http://www.w3.org/2000/svg', 'animateTransform'))
61 if (targetElement.outerHTML)
62 targetElement.outerHTML = ""
63 var all = document.getElementsByTagName("*");
64 var newParent = all[66 % all.length];
65 newParent.insertBefore(targetElement, newParent.childNodes[98 % newParent.childNodes.length])
67 document.addEventListener("load", load, true);
68 </script>
69 <style>
70 *{zoom:5%;}
71 .CLASS13{white-space:pre-wrap;background-image:url('?');</style>
72 <link>
73 <object>
74 <table>
75 <caption>
76 <textarea></textarea>
77 <button>
78 <em></em>
79 <div>
80 <h1 class="CLASS13">
81 <span></span>
82 <form></svg>
83 <ruby>
84 <rb<select tabindex="-1">
85 <optgroup>
86 <option>
87 <rt>
88 <select>
89 <optgroup></optgroup>
90 <option>
91 <option>