LibWeb: Support relative lengths in stop-color calcs

This commit is contained in:
Callum Law 2025-07-19 16:00:37 +12:00 committed by Sam Atkins
commit 3b52b1139a
Notes: github-actions[bot] 2025-08-04 10:30:24 +00:00
7 changed files with 32 additions and 25 deletions

View file

@ -46,11 +46,11 @@ void SVGStopElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties>
});
}
Gfx::Color SVGStopElement::stop_color() const
Gfx::Color SVGStopElement::stop_color()
{
if (auto computed_properties = this->computed_properties())
return computed_properties->stop_color();
return Color::Black;
return computed_properties->color_or_fallback(CSS::PropertyID::StopColor, CSS::ColorResolutionContext::for_element({ *this }), CSS::InitialValues::stop_color());
return CSS::InitialValues::stop_color();
}
float SVGStopElement::stop_opacity() const