LibWeb: Keep track of CSS property source declarations

This allows us to figure out where a specific CSS property comes from,
which is going to be used in a future commit to uniquely identify
running animations.
This commit is contained in:
Ali Mohammad Pur 2023-05-26 23:25:25 +03:30 committed by Andreas Kling
parent 279924242d
commit b7e3a68bfc
Notes: sideshowbarker 2024-07-17 03:51:15 +09:00
5 changed files with 223 additions and 210 deletions

View file

@ -37,15 +37,15 @@ 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::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors());
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors(), nullptr);
} 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::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors());
style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value()).release_value_but_fixme_should_propagate_errors(), nullptr);
} else if (name.equals_ignoring_ascii_case("background"sv)) {
VERIFY(m_background_style_value);
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value);
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value, nullptr);
}
});
}