Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / stale-style-selector-crash-1.html
bloba7e712892be523579b1cb1d5785f396b2dbd6530
1 <html>
2 <head id="head">
3 <style id="inlineRules">
4 #foo { background-color: red; }
5 </style>
6 </head>
7 <body>
8 <p>
9 Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13563">http://bugs.webkit.org/show_bug.cgi?id=13563</a>
10 REGRESSION: Crash loading message in Yahoo! Mail</i>.
11 </p>
12 <p>
13 The following line should say SUCCESS in green letters over a white background.
14 </p>
15 <div id="foo">SUCCESS</div>
16 <script>
17 function test()
19 var head = document.getElementById("head");
20 var link = document.createElement("link");
21 link.setAttribute("href", "data:text/css,");
22 link.setAttribute("rel", "stylesheet");
23 // This will increase the pending stylesheet count
24 head.appendChild(link);
26 var inline = document.getElementById("inlineRules");
27 // This will delete the rule (duh) but since we have
28 // pending stylesheets, will NOT update the style selector
29 inline.sheet.deleteRule(0);
31 // Make ourselves need a style recalc, so that
32 // updateRendering() will do something when called soon
33 document.getElementById("foo").style.color = "green";
35 if (window.testRunner)
36 testRunner.notifyDone();
39 if (window.testRunner) {
40 testRunner.dumpAsText();
41 testRunner.waitUntilDone();
44 setTimeout(test, 0);
45 </script>
46 </body>
47 </html>