LibWeb: Remove now-invalid attr() type support

Previously the type argument in attr() could be the name of a CSS type
on its own. This has changed, and now only `raw-string`
(previously `string`) or the name of a dimension unit is allowed. Other
types and more complex grammar use the `type()` function, which we
don't yet support.

I've updated the syntax comment, but not the algorithm itself, which
will be reimplemented in a later commit.
This commit is contained in:
Sam Atkins 2025-03-03 16:17:41 +00:00 committed by Tim Ledbetter
commit 8f01297182
Notes: github-actions[bot] 2025-07-09 15:46:32 +00:00
7 changed files with 22 additions and 153 deletions

View file

@ -13,12 +13,12 @@
serialize('attr(foo, "fallback")');
// FIXME: This should produce `attr(foo, "fallback")` but doesn't yet.
serialize('attr( foo , "fallback" )');
serialize('attr(foo string)');
// FIXME: This should produce `attr(foo string)` but doesn't yet.
serialize('attr( foo string )');
serialize('attr(foo string, "fallback")');
// FIXME: This should produce `attr(foo string, "fallback")` but doesn't yet.
serialize('attr( foo string , "fallback" )');
serialize('attr(foo raw-string)');
// FIXME: This should produce `attr(foo raw-string)` but doesn't yet.
serialize('attr( foo raw-string )');
serialize('attr(foo raw-string, "fallback")');
// FIXME: This should produce `attr(foo raw-string, "fallback")` but doesn't yet.
serialize('attr( foo raw-string , "fallback" )');
serialize(' attr(foo) attr(bar) attr(baz) ');
});
</script>