LibWeb: Rename ColorStyleValue -> CSSColorValue

This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#csscolorvalue

This is not (yet) the same as the CSSColorValue, but one step at a time.
This commit is contained in:
Sam Atkins 2024-08-14 16:37:02 +01:00 committed by Sam Atkins
parent 8952764267
commit 581d00293c
Notes: github-actions[bot] 2024-08-21 09:53:16 +00:00
17 changed files with 52 additions and 51 deletions

View file

@ -9,8 +9,8 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/CSSColorValue.h>
#include <LibWeb/CSS/StyleValues/CSSKeywordValue.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
#include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/HTMLCollection.h>
@ -76,7 +76,7 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2: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::ColorStyleValue::create(color.value()));
style.set_property(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create(color.value()));
return;
}
if (name == HTML::AttributeNames::cellspacing) {
@ -92,7 +92,7 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
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)));
style.set_property(color_property, CSS::CSSColorValue::create(Color(128, 128, 128)));
};
apply_border_style(CSS::PropertyID::BorderLeftStyle, CSS::PropertyID::BorderLeftWidth, CSS::PropertyID::BorderLeftColor);
apply_border_style(CSS::PropertyID::BorderTopStyle, CSS::PropertyID::BorderTopWidth, CSS::PropertyID::BorderTopColor);