Verify selector specifying extended filtering of :lang() pseudo class

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS document.querySelectorAll(":lang(en)").length is 3
PASS document.querySelectorAll(":lang(en-)").length is 2
PASS document.querySelectorAll(":lang(en--)").length is 1
PASS document.querySelectorAll(":lang(en---)").length is 0

PASS document.querySelectorAll(":lang(de-de)").length is 8
PASS document.querySelectorAll(":lang(de-DE)").length is 8
PASS document.querySelectorAll(":lang(DE-de)").length is 8
PASS document.querySelectorAll(":lang(dE-dE)").length is 8
PASS document.querySelectorAll(":lang(De-De)").length is 8
PASS document.querySelectorAll(":lang(DE-DE)").length is 8
PASS document.querySelectorAll(":lang(Latn)").length is 1
PASS document.querySelectorAll(":lang(Latf)").length is 1
PASS document.querySelectorAll(":lang(Latn-de)").length is 1
PASS document.querySelectorAll(":lang(Latf-de)").length is 1
PASS document.querySelectorAll(":lang(Latn, de-Latn)").length is 3
PASS document.querySelectorAll(":lang(Latf, de-Latf)").length is 2
PASS document.querySelectorAll(":lang(Latn, de-Latn)").length is 3
PASS document.querySelectorAll(":lang(Latf, de-Latf)").length is 2
PASS document.querySelectorAll(":lang(de-DE--, de-DE--)").length is 0

PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[0]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[1]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[2]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[3]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[4]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[5]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[6]).color is "rgb(1, 2, 3)"
PASS getComputedStyle(document.querySelectorAll(":lang(de-DE, DE-de)")[7]).color is "rgb(1, 2, 3)"

PASS getComputedStyle(document.querySelector(":lang(Latn, Latn-de)")).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelector(":lang(Latf, Latf-de)")).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelector(":lang(Latf, Latn)")).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelector(":lang(Latf, Latn)")).color is "rgb(0, 0, 0)"

PASS document.querySelectorAll(":lang(-en)").length is 0
PASS document.querySelectorAll(":lang(-en-)").length is 0
PASS document.querySelectorAll(":lang(-en--)").length is 0
PASS document.querySelectorAll(":lang(-en, -en-)").length is 0
PASS document.querySelectorAll(":lang(-en-, -en--)").length is 0

PASS document.querySelectorAll(":lang(fr-x)").length is 0
PASS document.querySelectorAll(":lang(fr-xenomorph)").length is 1

PASS document.querySelectorAll(":lang(cocoa-1)").length is 0
PASS document.querySelectorAll(":lang(cocoa-a)").length is 0
PASS document.querySelectorAll(":lang(cocoa-bar)").length is 0
PASS document.querySelectorAll(":lang(cocoa-1, cocoa-bar)").length is 0
PASS document.querySelectorAll(":lang(cocoa-a, cocoa-bar)").length is 0
PASS document.querySelectorAll(":lang(cocoa-1, cocoa-a)").length is 0

PASS document.querySelectorAll(":lang(foo)").length is 1
PASS document.querySelectorAll(":lang(foo-bar)").length is 1
PASS document.querySelectorAll(":lang(foo--bar)").length is 1
PASS document.querySelectorAll(":lang(foo-)").length is 1
PASS document.querySelectorAll(":lang(foo--)").length is 0
PASS document.querySelectorAll(":lang(foo, foo-)").length is 1
PASS document.querySelectorAll(":lang(foo-bar, foo--bar)").length is 1
PASS document.querySelectorAll(":lang(foo-, foo--)").length is 1
PASS document.querySelectorAll(":lang(foo--, foo---)").length is 0
PASS document.querySelectorAll(":lang(id)").length is 1
PASS document.querySelectorAll(":lang(id-)").length is 1
PASS document.querySelectorAll(":lang(id--)").length is 1
PASS document.querySelectorAll(":lang(id---Java)").length is 1
PASS document.querySelectorAll(":lang(id--Java)").length is 1
PASS document.querySelectorAll(":lang(id-Java)").length is 1
PASS document.querySelectorAll(":lang(id---)").length is 0
PASS document.querySelectorAll(":lang(id, id-)").length is 1
PASS document.querySelectorAll(":lang(id-, id--)").length is 1
PASS document.querySelectorAll(":lang(id--Java, id---Java)").length is 1
PASS document.querySelectorAll(":lang(id-Java, id--Java)").length is 1
PASS document.querySelectorAll(":lang(id---, id----)").length is 0

PASS document.querySelectorAll(":lang(tic-tac-toe)").length is 1
PASS document.querySelectorAll(":lang(tic-toe-tac)").length is 0

PASS document.querySelectorAll(":lang(\\*)").length is 35
PASS document.querySelectorAll(':lang("*-CH")').length is 5

PASS document.querySelectorAll(":lang(a)").length is 2
PASS document.querySelectorAll(":lang(a-\\*)").length is 1
PASS document.querySelectorAll(':lang("*-fr-\\*")').length is 2
PASS document.querySelectorAll(':lang("*-\\*-lang")').length is 2
PASS document.querySelectorAll(':lang("*-\\*-aa-bb-cc-dd")').length is 3
PASS document.querySelectorAll(':lang("*-\\*-\\*-bb-cc-dd")').length is 3
PASS document.querySelectorAll(':lang("*-\\*-\\*-\\*-cc-dd")').length is 3
PASS document.querySelectorAll(':lang("*-\\*-\\*-\\*-\\*-dd")').length is 3
PASS document.querySelectorAll(':lang("*-\\*-\\*-\\*-\\*-\\*")').length is 3
PASS document.querySelectorAll(':lang("*-\\*-aa-\\*-cc-\\*")').length is 3
PASS document.querySelectorAll(':lang("*-\\*-\\*-bb-\\*")').length is 3
PASS document.querySelectorAll(":lang(fooÃ‰)").length is 1
PASS document.querySelectorAll(":lang(fOOÃ‰)").length is 1
PASS document.querySelectorAll(":lang(FoOÃ‰)").length is 1
PASS document.querySelectorAll(":lang(FOOÃ‰)").length is 1
PASS document.querySelectorAll(":lang(fooÃ©)").length is 0
PASS document.querySelectorAll(":lang(FOOÃ©)").length is 0
PASS document.querySelectorAll(":lang(foÃ¶Ã‰-bÃr)").length is 1
PASS document.querySelectorAll(":lang(FoÃ¶Ã‰-bÃr)").length is 1
PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-bÃr)").length is 1
PASS document.querySelectorAll(":lang(FOÃ²Ã‰-bÃr)").length is 0
PASS document.querySelectorAll(":lang(FOÃ²Ä™-bÃr)").length is 0
PASS document.querySelectorAll(":lang(foÃ¶Ã‰-\\*)").length is 1
PASS document.querySelectorAll(":lang(\\*-bÃr)").length is 1
PASS document.querySelectorAll(":lang(\\*-BÃr)").length is 1
PASS document.querySelectorAll(":lang(\\*-BÃR)").length is 1
PASS document.querySelectorAll(":lang(\\*-BÃ¡r)").length is 0
PASS document.querySelectorAll(":lang(\\*-bÃ¡R)").length is 0
PASS document.querySelectorAll(":lang(\\*-BÃ¡R)").length is 0

PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-BÃr)").length is 1
PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-BÃ)").length is 0
PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-B)").length is 0
PASS document.querySelectorAll(":lang(f-BÃr)").length is 0
PASS document.querySelectorAll(":lang(fO-BÃr)").length is 0
PASS document.querySelectorAll(":lang(fOÃ¶-BÃr)").length is 0
PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-BÃr1)").length is 0
PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-BÃr12)").length is 0
PASS document.querySelectorAll(":lang(FOÃ¶Ã‰-BÃr123)").length is 0
PASS document.querySelectorAll(":lang(F-Xe)").length is 0
PASS document.querySelectorAll(":lang(Fr-Xe)").length is 0
PASS document.querySelectorAll(":lang(fr-Xe)").length is 0
PASS document.querySelectorAll(":lang(fr-Xen)").length is 0
PASS document.querySelectorAll(":lang(fr-Xeno)").length is 0
PASS document.querySelectorAll(":lang(fr-Xenom)").length is 0
PASS document.querySelectorAll(":lang(fr-Xenomo)").length is 0
PASS document.querySelectorAll(":lang(fr-Xenomor)").length is 0
PASS document.querySelectorAll(":lang(fr-Xenomorp)").length is 0
PASS document.querySelectorAll(":lang(fr-XÃ¨nÃ¶mÃ²rph)").length is 0
PASS document.querySelectorAll(":lang(FR-XENOMORPH)").length is 1
PASS document.querySelectorAll(":lang(foÃ¶Ã‰bÃr)").length is 1
PASS document.querySelectorAll(":lang(foÃ¶Ã‰bÃ)").length is 0
PASS document.querySelectorAll(":lang(foÃ¶Ã‰b)").length is 0
PASS document.querySelectorAll(":lang(foÃ¶Ã‰)").length is 1
PASS document.querySelectorAll(":lang(foÃ¶)").length is 0
PASS document.querySelectorAll(":lang(fo)").length is 0
PASS document.querySelectorAll(":lang(f)").length is 0

PASS document.querySelectorAll(":lang(*)").length threw exception Error: SyntaxError: DOM Exception 12.
PASS document.querySelectorAll(":lang(*foÃ¶Ã‰)").length threw exception Error: SyntaxError: DOM Exception 12.
PASS document.querySelectorAll(":lang(--en--)").length threw exception Error: SyntaxError: DOM Exception 12.
PASS document.querySelectorAll(":lang(---en---)").length threw exception Error: SyntaxError: DOM Exception 12.
PASS document.querySelectorAll(":lang(en us- de- fr-).length") threw exception Error: SyntaxError: DOM Exception 12.
PASS document.querySelectorAll(":lang(-\\* \\*-)").length threw exception Error: SyntaxError: DOM Exception 12.
PASS successfullyParsed is true

TEST COMPLETE

