4 if (window.layoutTestController) {
5 window.layoutTestController.keepWebHistory();
6 window.layoutTestController.dumpAsText();
9 function compareStyles()
11 if (window.layoutTestController) {
12 var firstStyle = window.layoutTestController.computedStyleIncludingVisitedInfo(document.getElementById('one'));
13 var secondStyle = window.layoutTestController.computedStyleIncludingVisitedInfo(document.getElementById('two'));
14 if (firstStyle.color == secondStyle.color) {
15 document.getElementById('result').innerHTML = 'FAIL';
20 var firstStyle = window.getComputedStyle(document.getElementById('one'), "");
21 var secondStyle = window.getComputedStyle(document.getElementById('two'), "");
22 if (firstStyle.color != secondStyle.color) {
23 document.getElementById('result').innerHTML = 'FAIL';
29 :link { color: orange }
30 :visited + :link { color: green }
31 :visited { color: green }
34 <body onload="compareStyles()">
35 <iframe src="resources/dummy.html" style="display:none"></iframe>
38 These two links should be different colors (green and orange):
40 <p style="color:green">
41 <a href="resources/dummy.html" id="one">One</a>
42 <a href="http://madeup.site.com" id="two">Two</a>