1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +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

@ -25,7 +25,7 @@ public:
ValueID id() const { return m_id; }
virtual bool has_color() const override;
virtual Color to_color(Layout::NodeWithStyle const& node) const override;
virtual Color to_color(Optional<Layout::NodeWithStyle const&> node) const override;
virtual ErrorOr<String> to_string() const override;
bool properties_equal(IdentifierStyleValue const& other) const { return m_id == other.m_id; }