| <html> |
| <head> |
| <script> |
| if (window.testRunner) { |
| window.testRunner.keepWebHistory(); |
| window.testRunner.dumpAsText(); |
| } |
| |
| function compareStyles() |
| { |
| var anchor = document.createElement("a"); |
| anchor.href="http://madeup.site.com"; |
| anchor.setAttribute("id", "one"); |
| anchor.innerHTML = "One"; |
| document.getElementById('enclosure').appendChild(anchor); |
| |
| if (window.testRunner) { |
| var firstStyle = window.testRunner.computedStyleIncludingVisitedInfo(document.getElementById('one')); |
| var secondStyle = window.testRunner.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> |
| :link { color: inherit } |
| :visited { color: orange } |
| </style> |
| </head> |
| <body onload="compareStyles()"> |
| <iframe src="resources/dummy.html" style="display:none"></iframe> |
| |
| <p> |
| These two links should be different colors (green and orange): |
| </p> |
| <p style="color:green"> |
| <a id="enclosure" href="resources/dummy.html"></a> |
| <a href="resources/dummy.html" id="two">Two</a> |
| </p> |
| |
| <script> |
| |
| </script> |
| |
| <p id=result> |
| PASS |
| </p> |
| </body> |
| </html> |