From 44bfca369abe79bd882607cb169f12986da0fc43 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 26 Mar 2022 16:06:31 +0100 Subject: [PATCH] LibWeb: Resolve style values from the element inline style This will set the background color in the project header on GitHub! :^) --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 9ead1df5a9..59e6f6e4a9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -571,7 +571,12 @@ void StyleComputer::cascade_declarations(StyleProperties& style, DOM::Element& e for (auto const& property : inline_style->properties()) { if (important != property.important) continue; - set_property_expanding_shorthands(style, property.property_id, property.value, m_document); + auto property_value = property.value; + if (property.value->is_unresolved()) { + if (auto resolved = resolve_unresolved_style_value(element, property.property_id, property.value->as_unresolved())) + property_value = resolved.release_nonnull(); + } + set_property_expanding_shorthands(style, property.property_id, property_value, m_document); } } }