| <html> |
| <head> |
| <script> |
| if (window.layoutTestController) { |
| window.layoutTestController.keepWebHistory(); |
| window.layoutTestController.dumpAsText(); |
| } |
| |
| function compareStyles() |
| { |
| if (window.layoutTestController) { |
| var firstStyle = window.layoutTestController.computedStyleIncludingVisitedInfo(document.getElementById('one')); |
| var secondStyle = window.layoutTestController.computedStyleIncludingVisitedInfo(document.getElementById('two')); |
| if (firstStyle.color != secondStyle.color) { |
| document.getElementById('result').innerHTML = 'FAIL'; |
| return; |
| } |
| } |
| |
| var firstStyle = window.getComputedStyle(document.getElementById('one'), ""); |
| var secondStyle = window.getComputedStyle(document.getElementById('two'), ""); |
| if (firstStyle.color == secondStyle.color) { |
| document.getElementById('result').innerHTML = 'FAIL'; |
| return; |
| } |
| } |
| </script> |
| <style> |
| #one:link { color: green } |
| #two:link { color: purple } |
| #one:visited { color: orange } |
| #two.test:visited { color: orange } |
| </style> |
| </head> |
| <body onload="compareStyles()"> |
| <iframe src="resources/dummy.html" style="display:none"></iframe> |
| |
| <p> |
| These two links should be the same color (orange): |
| </p> |
| <p> |
| <a href="resources/dummy.html" id="one">One</a> |
| <a href="resources/dummy.html" id="two" class="test">Two</a><br> |
| </p> |
| <p id=result> |
| PASS |
| </p> |
| </body> |
| </html> |