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
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

@ -175,7 +175,7 @@ static RefPtr<CSSStyleValue const> style_value_for_shadow(Vector<ShadowData> con
auto make_shadow_style_value = [](ShadowData const& shadow) {
return ShadowStyleValue::create(
CSSColorValue::create(shadow.color),
CSSColorValue::create_from_color(shadow.color),
style_value_for_length_percentage(shadow.offset_x),
style_value_for_length_percentage(shadow.offset_y),
style_value_for_length_percentage(shadow.blur_radius),
@ -237,23 +237,23 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
// -> A resolved value special case property like color defined in another specification
// The resolved value is the used value.
case PropertyID::BackgroundColor:
return CSSColorValue::create(layout_node.computed_values().background_color());
return CSSColorValue::create_from_color(layout_node.computed_values().background_color());
case PropertyID::BorderBottomColor:
return CSSColorValue::create(layout_node.computed_values().border_bottom().color);
return CSSColorValue::create_from_color(layout_node.computed_values().border_bottom().color);
case PropertyID::BorderLeftColor:
return CSSColorValue::create(layout_node.computed_values().border_left().color);
return CSSColorValue::create_from_color(layout_node.computed_values().border_left().color);
case PropertyID::BorderRightColor:
return CSSColorValue::create(layout_node.computed_values().border_right().color);
return CSSColorValue::create_from_color(layout_node.computed_values().border_right().color);
case PropertyID::BorderTopColor:
return CSSColorValue::create(layout_node.computed_values().border_top().color);
return CSSColorValue::create_from_color(layout_node.computed_values().border_top().color);
case PropertyID::BoxShadow:
return style_value_for_shadow(layout_node.computed_values().box_shadow());
case PropertyID::Color:
return CSSColorValue::create(layout_node.computed_values().color());
return CSSColorValue::create_from_color(layout_node.computed_values().color());
case PropertyID::OutlineColor:
return CSSColorValue::create(layout_node.computed_values().outline_color());
return CSSColorValue::create_from_color(layout_node.computed_values().outline_color());
case PropertyID::TextDecorationColor:
return CSSColorValue::create(layout_node.computed_values().text_decoration_color());
return CSSColorValue::create_from_color(layout_node.computed_values().text_decoration_color());
// NOTE: text-shadow isn't listed, but is computed the same as box-shadow.
case PropertyID::TextShadow:
return style_value_for_shadow(layout_node.computed_values().text_shadow());
@ -513,7 +513,7 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
return style_value_for_sided_shorthand(top.release_nonnull(), right.release_nonnull(), bottom.release_nonnull(), left.release_nonnull());
}
case PropertyID::WebkitTextFillColor:
return CSSColorValue::create(layout_node.computed_values().webkit_text_fill_color());
return CSSColorValue::create_from_color(layout_node.computed_values().webkit_text_fill_color());
case PropertyID::Invalid:
return CSSKeywordValue::create(Keyword::Invalid);
case PropertyID::Custom: