<!doctype html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<style>
* {
    color: rgb(0, 0, 0);
}
:lang() {
    color: rgb(1, 2, 3);
}

:lang() * {
    color: rgb(4, 5, 6);
}
</style>
</head>
<body>
    <div style="display:none">
        <a>
            <b>
                <c id="target1"></c>
            </b>
        </a>
    </div>
</body>
<script>
description('Verify invalid :lang() selectors.');

shouldThrow('document.querySelectorAll(":lang()").length');
shouldThrow('document.querySelectorAll(":lang(lang()").length');
shouldThrow('document.querySelectorAll(":lang(:lang(id)").length');
shouldThrow('document.querySelectorAll(":lang(:lang(en, br)").length');

debug('')

shouldThrow('document.querySelectorAll(":lang(<0_0>)").length');
shouldThrow('document.querySelectorAll(":lang(9)").length');
shouldThrow('document.querySelectorAll(":lang(99)").length');
shouldThrow('document.querySelectorAll(":lang(999)").length');

debug('')

shouldThrow('document.querySelectorAll(":lang(})").length');
shouldThrow('document.querySelectorAll(":lang({)").length');
shouldThrow('document.querySelectorAll(":lang({}")).length');
shouldThrow('document.querySelectorAll(":lang(()").length');
shouldThrow('document.querySelectorAll(":lang())").length');
shouldThrow('document.querySelectorAll(":lang(()")).length');
shouldThrow('document.querySelectorAll(":lang(])").length');
shouldThrow('document.querySelectorAll(":lang([)").length');
shouldThrow('document.querySelectorAll(":lang([])").length');
shouldThrow('document.querySelectorAll(":lang(@media screen {})").length');
shouldThrow('document.querySelectorAll(":lang(@font-face {})").length');
shouldThrow('document.querySelectorAll(":lang(:)").length');
shouldThrow('document.querySelectorAll(":lang(;)").length');
shouldThrow('document.querySelectorAll(":lang(.)").length');
shouldThrow('document.querySelectorAll(":lang(+)").length');
shouldThrow('document.querySelectorAll(":lang(-)").length');
shouldThrow('document.querySelectorAll(":lang(=)").length');
shouldThrow('document.querySelectorAll(":lang(&&)").length');

debug('')

shouldBeEqualToString('getComputedStyle(document.getElementById("target1")).color', 'rgb(0, 0, 0)');
</script>
<script src="../../resources/js-test-post.js"></script>
</html>
