LibWeb: Treat "revert" as a CSS-wide keyword

This isn't included in the base definition of a CSS-wide keyword, but
the CASCADE-4 spec which adds it says:

> The revert CSS-wide keyword rolls back the cascade to the cascaded
  value of the earlier origin.

So it is one. While I'm at it, rename `is_builtin()` to match the spec
terminology. It's not used currently, but will be in the next commit.
This commit is contained in:
Sam Atkins 2023-09-20 16:58:45 +01:00 committed by Sam Atkins
parent aea112da71
commit 1c4a05f8a4
Notes: sideshowbarker 2024-07-16 21:39:23 +09:00
2 changed files with 5 additions and 1 deletions

View file

@ -71,10 +71,12 @@ Optional<ValueID> value_id_from_string(StringView);
StringView string_from_value_id(ValueID);
// https://www.w3.org/TR/css-values-4/#common-keywords
// https://drafts.csswg.org/css-cascade-4/#valdef-all-revert
inline bool is_css_wide_keyword(StringView name)
{
return name.equals_ignoring_ascii_case("inherit"sv)
|| name.equals_ignoring_ascii_case("initial"sv)
|| name.equals_ignoring_ascii_case("revert"sv)
|| name.equals_ignoring_ascii_case("unset"sv);
}