LibWeb: Move CSS classes into the Web::CSS namespace

This commit is contained in:
Andreas Kling 2020-07-26 20:01:35 +02:00
parent 3e389f4cdc
commit 1f008c95b6
Notes: sideshowbarker 2024-07-19 04:35:42 +09:00
100 changed files with 358 additions and 366 deletions

View file

@ -40,17 +40,17 @@ HTMLBodyElement::~HTMLBodyElement()
{
}
void HTMLBodyElement::apply_presentational_hints(StyleProperties& style) const
void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
for_each_attribute([&](auto& name, auto& value) {
if (name.equals_ignoring_case("bgcolor")) {
auto color = Color::from_string(value);
if (color.has_value())
style.set_property(CSS::PropertyID::BackgroundColor, ColorStyleValue::create(color.value()));
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()));
} else if (name.equals_ignoring_case("text")) {
auto color = Color::from_string(value);
if (color.has_value())
style.set_property(CSS::PropertyID::Color, ColorStyleValue::create(color.value()));
style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value()));
} else if (name.equals_ignoring_case("background")) {
ASSERT(m_background_style_value);
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value);
@ -74,7 +74,7 @@ void HTMLBodyElement::parse_attribute(const FlyString& name, const String& value
if (color.has_value())
document().set_visited_link_color(color.value());
} else if (name.equals_ignoring_case("background")) {
m_background_style_value = ImageStyleValue::create(document().complete_url(value), const_cast<DOM::Document&>(document()));
m_background_style_value = CSS::ImageStyleValue::create(document().complete_url(value), const_cast<DOM::Document&>(document()));
}
}