<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
description(":visited inside :not should be always matched.");
jsTestIsAsync = true;

if (window.testRunner)
    window.testRunner.keepWebHistory();

var count = 0;
function finish() {
    if (++count === 2) {
        finishJSTest();
    }
}

function compareStyles()
{
    if (window.internals) {
        oneStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById("one"));
        twoStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById("two"));
        shouldBecomeEqualToString("oneStyle.color", "rgb(0, 128, 0)", finish);
        shouldBecomeEqualToString("twoStyle.color", "rgb(0, 128, 0)", finish);
    }
}
</script>
<style>
a { color: red; }
#area1 a:not(:visited) {
    color: green;
}
#area2 :not(:visited) {
    color: green;
}
</style>
</head>
<body onload="compareStyles()">
<iframe src="resources/dummy.html" style="display:none"></iframe>

<p>color of One and Two should be green:</p>
<div>
<p id="area1"><a id="one" href="http://madeup.site.com">One</a></p>
<p><a href="http://madeup.site.com"><span id="area2"><span id="two">Two</span></span></a></p>
</div>

<div id=console></div>
</body>
<script src="../../resources/js-test-post.js"></script>
</html>
