Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / shared-inline-style-after-node-removal.html
blob74d1cd6734c286d53356404bb8fc82b175e31296
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <div id="test" style="color: red">
9 <p style="color: green"></p>
10 <p style="color: green"></p>
11 </div>
12 <script>
14 jsTestIsAsync = true;
16 description("This test checks that an element that shared its inline style with one or more other elements still retain that style after one of the sharing elements was destroyed.");
18 var testDiv = document.getElementById('test');
19 var pees = testDiv.getElementsByTagName('p');
21 testDiv.removeChild(pees[1])
23 setTimeout("callMeMaybe()", 10);
24 gc();
26 function callMeMaybe()
28 var testDiv = document.getElementById('test');
29 var pees = testDiv.getElementsByTagName('p');
31 // Trigger a style recalc on pees[0].
32 pees[0].style.background = 'white';
34 computedStyle = getComputedStyle(pees[0]);
35 shouldBe("computedStyle.color", "'rgb(0, 128, 0)'");
36 finishJSTest();
39 </script>
40 </body>
41 </html>