4 <div>Test passes if it does not crash.
</div>
6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
11 function reloadUntil(max
) {
12 var index
= window
.location
.href
.indexOf("?");
14 window
.location
.href
= window
.location
.href
+ "?1";
16 var num
= parseInt(window
.location
.href
.substring(index
+ 1));
18 if (window
.testRunner
)
19 testRunner
.notifyDone();
21 window
.location
.href
= window
.location
.href
.substring(0, index
+ 1) + (num
+ 1);
27 var shadowHost
= document
.createElement("SHADOWHOST");
28 var shadowRoot
= shadowHost
.createShadowRoot();
29 var child
= document
.createElement("CHILD");
30 shadowRoot
.appendChild(child
);
31 child
.style
.zoom
= 34;
32 var styleAttr
= child
.attributes
[0];
33 child
.removeAttribute("style");
34 shadowHost
.appendChild(shadowRoot
);
36 // The crash (use-after-free) is flaky. We have to reload the page a number of times to reproduce the crash.
37 // I couldn't find a reliable way to reproduce, such as using gc(), adjusting the scopes of variables and so on.
38 // As of now, we can hit a crash by reloading about 50 times.
42 document
.addEventListener("DOMContentLoaded", init
, false);