OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script> |
| 6 var white = "rgb(255, 255, 255)"; |
| 7 var green = "rgb(0, 255, 0)"; |
| 8 var yellow = "rgb(255, 255, 0)"; |
| 9 var red = "rgb(255, 0, 0)"; |
| 10 |
| 11 function onMouseDown() { |
| 12 if (!window.internals) { |
| 13 console.log('No internals'); |
| 14 return; |
| 15 } |
| 16 |
| 17 shouldBe("getComputedStyle(window.document.body).backgroundColor", "white"); |
| 18 |
| 19 vlink.offsetTop; |
| 20 shouldBe("internals.computedStyleIncludingVisitedInfo(vlink).color", "green"
); |
| 21 |
| 22 alink.offsetTop; |
| 23 shouldBe("internals.computedStyleIncludingVisitedInfo(alink).color", "yellow
"); |
| 24 |
| 25 link.offsetTop; |
| 26 shouldBe("internals.computedStyleIncludingVisitedInfo(link).color", "red"); |
| 27 |
| 28 if (window.testRunner) |
| 29 testRunner.notifyDone(); |
| 30 } |
| 31 |
| 32 function runTest() { |
| 33 if (!window.eventSender) { |
| 34 console.log('No event sender'); |
| 35 return; |
| 36 } |
| 37 |
| 38 eventSender.mouseMoveTo(alink.offsetLeft + 5, alink.offsetTop + 5); |
| 39 eventSender.mouseDown(); |
| 40 } |
| 41 |
| 42 if (window.testRunner) |
| 43 testRunner.waitUntilDone(); |
| 44 </script> |
| 45 </head> |
| 46 <body bgcolor="ffffff" link="ffzz" vlink="00ffx" alink="ffff0x" onload="runTest(
);"> |
| 47 This should have a white background. |
| 48 <a href="" id="vlink">This text should be green.</a> |
| 49 <a href="javascript:" id="alink" onmousedown="onMouseDown()">This text should be
yellow while active.</a> |
| 50 <a href="#" id="link" >This text should be red.</a> |
| 51 </body> |
| 52 </html> |
OLD | NEW |