1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibWeb: Make StyleValue::to_color() take a Node instead of the Document

This is in preparation for the `currentcolor` value, which needs to know
what Node it's on so it can check the `color`.
This commit is contained in:
Sam Atkins 2021-09-16 19:20:20 +01:00 committed by Andreas Kling
parent 8657148194
commit 86f78bff2a
6 changed files with 18 additions and 17 deletions

View file

@ -286,7 +286,7 @@ public:
virtual String to_string() const = 0;
virtual Length to_length() const { return {}; }
virtual Color to_color(const DOM::Document&) const { return {}; }
virtual Color to_color(Layout::NodeWithStyle const&) const { return {}; }
CSS::ValueID to_identifier() const;
@ -607,7 +607,7 @@ public:
Color color() const { return m_color; }
String to_string() const override { return m_color.to_string(); }
Color to_color(const DOM::Document&) const override { return m_color; }
Color to_color(Layout::NodeWithStyle const&) const override { return m_color; }
virtual bool equals(const StyleValue& other) const override
{
@ -637,7 +637,7 @@ public:
CSS::ValueID id() const { return m_id; }
virtual String to_string() const override;
virtual Color to_color(const DOM::Document&) const override;
virtual Color to_color(Layout::NodeWithStyle const& node) const override;
virtual bool equals(const StyleValue& other) const override
{