LibWeb: Rename CSSColorValue::create() to create_from_color()

Soon, CSSColorValue will be an abstract class, and we'll instead create
a CSSRGB, CSSHSL, or other specific color type from the Typed-OM spec.
However, it's still useful to have an easy "just give me a style value
for this color" method. So change the name to distinguish this from the
usual StyleValue::create() methods.
This commit is contained in:
Sam Atkins 2024-08-15 11:15:44 +01:00 committed by Sam Atkins
parent 4e48afd9a7
commit 37ea4e3b5f
Notes: github-actions[bot] 2024-08-21 09:53:06 +00:00
11 changed files with 24 additions and 24 deletions

View file

@ -46,12 +46,12 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co
// https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value
auto color = parse_legacy_color_value(value);
if (color.has_value())
style.set_property(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create(color.value()));
style.set_property(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create_from_color(color.value()));
} else if (name.equals_ignoring_ascii_case("text"sv)) {
// https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-2
auto color = parse_legacy_color_value(value);
if (color.has_value())
style.set_property(CSS::PropertyID::Color, CSS::CSSColorValue::create(color.value()));
style.set_property(CSS::PropertyID::Color, CSS::CSSColorValue::create_from_color(color.value()));
} else if (name.equals_ignoring_ascii_case("background"sv)) {
VERIFY(m_background_style_value);
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value);