<!doctype html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<style>
.target {
    background-color:rgb(255, 255, 255);
}
.parent:not(:first-child) .target {
    background-color:rgb(10, 11, 12);
}
</style>
</head>
<body>
<div>
    <ancestor>
        <span class="parent">
            <span id="target4" class="target"></span>
        </span>
        <span class="parent">
            <span id="target5" class="target"></span>
        </span>
        <span class="parent">
            <span id="target6" class="target"></span>
        </span>
    </ancestor>
</div>
</body>
<script>
description(':not(:first-child) should be worked for the first element beyond rendering');
shouldBeEqualToString('getComputedStyle(document.getElementById("target4")).backgroundColor', 'rgb(255, 255, 255)');
shouldBeEqualToString('getComputedStyle(document.getElementById("target5")).backgroundColor', 'rgb(10, 11, 12)');
shouldBeEqualToString('getComputedStyle(document.getElementById("target6")).backgroundColor', 'rgb(10, 11, 12)');

var target6Parent = document.getElementById("target6").parentElement;
var parentElement = target6Parent.parentElement;
parentElement.insertBefore(target6Parent, parentElement.firstChild);

shouldBeEqualToString('getComputedStyle(document.getElementById("target6")).backgroundColor', 'rgb(255, 255, 255)');
shouldBeEqualToString('getComputedStyle(document.getElementById("target4")).backgroundColor', 'rgb(10, 11, 12)');
shouldBeEqualToString('getComputedStyle(document.getElementById("target5")).backgroundColor', 'rgb(10, 11, 12)');
</script>
<script src="../../resources/js-test-post.js"></script>
</html>
