ladybird/Tests/LibWeb/Text/input/css/invalid-selector-in-has.html

22 lines
645 B
HTML

<!DOCTYPE html>
<style id="style"></style>
<script src="../include.js"></script>
<script>
test(() => {
let selectors = [
":has(:yakthonk)",
":has(:not(:yakthonk))",
":has(:has(span))",
":has(:not(:has(span)))",
":has(::before)",
":has(:not(::before))",
];
let style = document.getElementById("style");
for (let selector of selectors) {
style.innerText = `${selector} { color: red; }`;
println(`${selector} should be invalid: ${style.sheet.cssRules.length === 0 ? "PASS" : "FAIL"}`);
}
});
</script>