OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <style> | |
3 div { background: rgb(0, 0, 0); } | |
4 div:active { background: rgb(0, 255, 0); } | |
5 div { | |
6 width: 200px; | |
7 height: 200px; | |
8 border: 2px solid rgb(0, 0, 255); | |
9 } | |
10 div span { | |
11 color: rgb(255, 255, 255); | |
12 } | |
13 div:active span { | |
14 color: rgb(255, 0, 0); | |
15 display: none; | |
16 } | |
17 </style> | |
18 | |
19 <div id="box"><span>Text in a span</span></div> | |
20 | |
21 <pre id="description"></div> | |
Inactive
2014/06/13 13:15:33
Why are those 2 <pre>...</pre> needed? AFAIK, the
spartha
2014/06/13 14:28:14
You are right, js-test.js adds these for us (adds
| |
22 <pre id="console"></pre> | |
23 | |
24 <script src="../../resources/js-test.js"></script> | |
25 <script> | |
26 function shouldHaveBackground(element, bg) { | |
27 background = getComputedStyle(element, null).getPropertyValue("background-co lor"); | |
28 shouldBeEqualToString('background', bg); | |
29 } | |
30 | |
31 function shouldHaveTextColor(element, textColor) { | |
32 color = getComputedStyle(element, null).getPropertyValue("color"); | |
33 shouldBeEqualToString('color', textColor); | |
34 } | |
35 | |
36 if (window.testRunner) { | |
37 description("Chain of active elements should be cleared, even if style :acti ve sets display: none on the current active element"); | |
Inactive
2014/06/13 13:15:33
This can probably be outside the if(window.testRun
spartha
2014/06/13 14:28:14
Done.
| |
38 var box = document.getElementById('box'); | |
39 testRunner.dumpAsText(); | |
Inactive
2014/06/13 13:15:33
This is the default.
spartha
2014/06/13 14:28:14
Done.
| |
40 | |
41 eventSender.dragMode = false; | |
42 // This mouse click seems to be required for WebKit's event handling to | |
43 // pick up the :hover class. See https://bugs.webkit.org/show_bug.cgi?id=742 64 | |
44 eventSender.mouseDown(); | |
45 eventSender.mouseUp(); | |
46 | |
47 var span = document.querySelector('span'); | |
48 var spanRect = span.getBoundingClientRect(); | |
49 // Move into the first box. | |
50 eventSender.mouseMoveTo(spanRect.left + 5, spanRect.top + 5); | |
51 eventSender.mouseDown(); | |
52 shouldHaveBackground(box, 'rgb(0, 255, 0)'); | |
53 eventSender.mouseUp(); | |
54 shouldHaveTextColor(span, 'rgb(255, 255, 255)'); | |
55 } | |
56 </script> | |
OLD | NEW |