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

@ -105,12 +105,12 @@ LengthBox StyleProperties::length_box(CSS::PropertyID left_id, CSS::PropertyID t
return box;
}
Color StyleProperties::color_or_fallback(CSS::PropertyID id, const DOM::Document& document, Color fallback) const
Color StyleProperties::color_or_fallback(CSS::PropertyID id, Layout::NodeWithStyle const& node, Color fallback) const
{
auto value = property(id);
if (!value.has_value())
return fallback;
return value.value()->to_color(document);
return value.value()->to_color(node);
}
void StyleProperties::load_font(Layout::Node const& node) const