REGRESSION (r254893): Apple Win 10 Debug build failure
[WebKit-https.git] / LayoutTests / fast / css / pseudo-target-indirect-sibling-002.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <style>
6 div.class { background-color: red; }
7 :hover {background-color:blue; }
8 :target~#first { background-color: green; }
9 </style>
10
11 </head>
12 <body onhashchange="hashchange();">
13 <p id="description"></p>
14 <div tabindex=1" id="first" class="class"></div>
15 <div tabindex=2" id="second" class="class"></div>
16 <div tabindex=3" id="third" class="class"></div>
17 <div tabindex=4" id="fourth" class="class"></div>
18 <div id="console"></div>
19 <script>
20 description('This test passes if it does not find the element whose id is "first", because even though it has a sibling whose id matches the fragment of the url of this test, that sibling comes after, not before the "first" element.');
21
22 jsTestIsAsync = true;
23
24 if (window.location.hash.indexOf("second") == -1)
25     window.location.hash = "#second";
26
27 function hashchange() {
28 el = document.getElementById("first");
29 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color')", "'rgb(255, 0, 0)'");
30
31 el = document.getElementById("second");
32 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color')", "'rgb(255, 0, 0)'");
33
34 el = document.getElementById("third");
35 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color')", "'rgb(255, 0, 0)'");
36
37 el = document.getElementById("fourth");
38 shouldBe("document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color')", "'rgb(255, 0, 0)'");
39 finishJSTest();
40 }
41 </script>
42 </body>
43 </html>