LibWeb: Rename "identifier" and "ValueID" to "Keyword" where correct

For a long time, we've used two terms, inconsistently:
- "Identifier" is a spec term, but refers to a sequence of alphanumeric
  characters, which may or may not be a keyword. (Keywords are a
  subset of all identifiers.)
- "ValueID" is entirely non-spec, and is directly called a "keyword" in
  the CSS specs.

So to avoid confusion as much as possible, let's align with the spec
terminology. I've attempted to change variable names as well, but
obviously we use Keywords in a lot of places in LibWeb and so I may
have missed some.

One exception is that I've not renamed "valid-identifiers" in
Properties.json... I'd like to combine that and the "valid-types" array
together eventually, so there's no benefit to doing an extra rename
now.
This commit is contained in:
Sam Atkins 2024-08-14 14:06:03 +01:00 committed by Sam Atkins
parent 9559f0f123
commit 6a74b01644
Notes: github-actions[bot] 2024-08-15 12:59:33 +00:00
48 changed files with 702 additions and 702 deletions

View file

@ -65,8 +65,8 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
}
if (name == HTML::AttributeNames::align) {
if (value.equals_ignoring_ascii_case("center"sv)) {
style.set_property(CSS::PropertyID::MarginLeft, CSS::CSSKeywordValue::create(CSS::ValueID::Auto));
style.set_property(CSS::PropertyID::MarginRight, CSS::CSSKeywordValue::create(CSS::ValueID::Auto));
style.set_property(CSS::PropertyID::MarginLeft, CSS::CSSKeywordValue::create(CSS::Keyword::Auto));
style.set_property(CSS::PropertyID::MarginRight, CSS::CSSKeywordValue::create(CSS::Keyword::Auto));
} else if (auto parsed_value = parse_css_value(CSS::Parser::ParsingContext { document() }, value, CSS::PropertyID::Float)) {
style.set_property(CSS::PropertyID::Float, parsed_value.release_nonnull());
}
@ -89,7 +89,7 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
if (!border)
return;
auto apply_border_style = [&](CSS::PropertyID style_property, CSS::PropertyID width_property, CSS::PropertyID color_property) {
auto legacy_line_style = CSS::CSSKeywordValue::create(CSS::ValueID::Outset);
auto legacy_line_style = CSS::CSSKeywordValue::create(CSS::Keyword::Outset);
style.set_property(style_property, legacy_line_style);
style.set_property(width_property, CSS::LengthStyleValue::create(CSS::Length::make_px(border)));
style.set_property(color_property, CSS::ColorStyleValue::create(Color(128, 128, 128)));