1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +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

@ -31,8 +31,9 @@ String IdentifierStyleValue::to_string() const
return CSS::string_from_value_id(m_id);
}
Color IdentifierStyleValue::to_color(const DOM::Document& document) const
Color IdentifierStyleValue::to_color(Layout::NodeWithStyle const& node) const
{
auto& document = node.document();
if (id() == CSS::ValueID::LibwebLink)
return document.link_color();