mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
This correctly rejects invalid trailing tokens from `anchor()` fallback values. Also introduces discard_whitespace() to take care of any whitespace between the fallback value and the closing parenthesis.
20 lines
692 B
HTML
20 lines
692 B
HTML
<!DOCTYPE html>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const el = document.createElement("div");
|
|
|
|
// No space before trailing garbage — must still be rejected.
|
|
el.style.top = "anchor(--foo top, anchor(--bar bottom)GARBAGE)";
|
|
println(`no space before garbage: ${el.style.top}`);
|
|
|
|
el.style.top = "anchor(--foo top, anchor(--bar bottom))";
|
|
println(`valid nested: ${el.style.top}`);
|
|
|
|
// Trailing whitespace after nested anchor() must be accepted.
|
|
el.style.top = "";
|
|
el.style.top = "anchor(--foo top, anchor(--bar bottom) )";
|
|
println(`trailing whitespace: ${el.style.top}`);
|
|
});
|
|
</script>
|