1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

LibWeb: Allow doing .to_color() on a StyleValue without a layout node

This will be needed to access the color of a stop from a SVG gradient
<stop> element (which does not participate in layout, so does not have
a layout node).
This commit is contained in:
MacDue 2023-04-19 18:31:00 +01:00 committed by Andreas Kling
parent 2013761feb
commit f099ee3d47
4 changed files with 12 additions and 7 deletions

View file

@ -285,7 +285,7 @@ public:
virtual ValueComparingNonnullRefPtr<StyleValue const> absolutized(CSSPixelRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, CSSPixels font_size, CSSPixels root_font_size, CSSPixels line_height, CSSPixels root_line_height) const;
virtual Color to_color(Layout::NodeWithStyle const&) const { return {}; }
virtual Color to_color(Optional<Layout::NodeWithStyle const&>) const { return {}; }
ValueID to_identifier() const;
virtual Length to_length() const { VERIFY_NOT_REACHED(); }
virtual float to_number() const { return 0; }