LibWeb/CSS: Rename CSSKeywordValue -> KeywordStyleValue

The typed-om CSSKeywordValue will need to be a separate class.
This commit is contained in:
Sam Atkins 2025-08-08 10:28:41 +01:00 committed by Tim Ledbetter
commit 4e92ab52e3
Notes: github-actions[bot] 2025-08-08 14:20:48 +00:00
51 changed files with 189 additions and 191 deletions

View file

@ -19,8 +19,8 @@
#include <LibWeb/Bindings/PrincipalHostDefined.h>
#include <LibWeb/CSS/ComputedProperties.h>
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/StyleValues/CSSKeywordValue.h>
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
#include <LibWeb/CSS/StyleValues/KeywordStyleValue.h>
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/ElementFactory.h>
@ -152,7 +152,7 @@ void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style)
// FIXME: Instead of overriding line-height, we should set height here instead.
if (current_line_height < minimum_line_height)
style.set_property(CSS::PropertyID::LineHeight, CSS::CSSKeywordValue::create(CSS::Keyword::Normal));
style.set_property(CSS::PropertyID::LineHeight, CSS::KeywordStyleValue::create(CSS::Keyword::Normal));
}
}
@ -1866,9 +1866,9 @@ void HTMLInputElement::apply_presentational_hints(GC::Ref<CSS::CascadedPropertie
for_each_attribute([&](auto& name, auto& value) {
if (name == HTML::AttributeNames::align) {
if (value.equals_ignoring_ascii_case("center"sv))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center));
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Center));
else if (value.equals_ignoring_ascii_case("middle"sv))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Middle));
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Middle));
} else if (name == HTML::AttributeNames::border) {
if (auto parsed_value = parse_non_negative_integer(value); parsed_value.has_value()) {
auto width_style_value = CSS::LengthStyleValue::create(CSS::Length::make_px(*parsed_value));
@ -1877,7 +1877,7 @@ void HTMLInputElement::apply_presentational_hints(GC::Ref<CSS::CascadedPropertie
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomWidth, width_style_value);
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderLeftWidth, width_style_value);
auto border_style_value = CSS::CSSKeywordValue::create(CSS::Keyword::Solid);
auto border_style_value = CSS::KeywordStyleValue::create(CSS::Keyword::Solid);
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderTopStyle, border_style_value);
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderRightStyle, border_style_value);
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomStyle, border_style_value);