Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-content/parsing/content-invalid.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Content Module Level 3: Invalid parsing</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
function test_invalid_value_combinations(property, value) {
test_invalid_value(property, value);
test_invalid_value(property, `${value} / "alt text"`);
}
function test_invalid_value_alt_text(property, value) {
test_invalid_value(property, `${value} / no-open-quote`);
test_invalid_value(property, `${value} / no-close-quote`);
test_invalid_value(property, `${value} / "hi" no-close-quote`);
}
test_invalid_value_combinations("content", `attr()`);
test_invalid_value_combinations("content", `counters(counter-name)`);
test_invalid_value_combinations("content", `counter()`);
test_invalid_value_alt_text("content", "open-quote");
test_invalid_value_alt_text("content", "close-quote");
test_invalid_value_alt_text("content", "no-open-quote");
test_invalid_value_alt_text("content", "no-close-quote");
test_invalid_value_alt_text("content", "counter(counter-name)");
test_invalid_value_alt_text("content", "counter(counter-name, counter-style)");
test_invalid_value_alt_text("content", `counters(counter-name, ".")`);
test_invalid_value_alt_text("content", `counters(counter-name, ".", counter-style)`);
test_invalid_value_alt_text("content", `"hello"`);
test_invalid_value_alt_text("content", `"hello" "world"`);
test_invalid_value_alt_text("content", `counter(counter-name) "potato"`);
test_invalid_value_alt_text("content", `counters(counter-name, ".") "potato"`);
test_invalid_value_alt_text("content", `"(" counters(counter-name, ".", counter-style) ")"`);
test_invalid_value_alt_text("content", `open-quote "hello" "world" close-quote`);
</script>
</body>
</html>