From 9d06c86fe4f5307fe4625af14871dfc320a56b20 Mon Sep 17 00:00:00 2001 From: Callum Law Date: Wed, 21 May 2025 17:18:19 +1200 Subject: [PATCH] LibWeb: Support shorthands as relevant_css_property for editing commands --- Libraries/LibWeb/Editing/Internal/Algorithms.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp index e4c1761e66a..2e15a125ff9 100644 --- a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp +++ b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp @@ -3910,9 +3910,11 @@ Optional specified_command_value(GC::Ref element, FlyStrin // 10. If element has a style attribute set, and that attribute has the effect of setting property, return the value // that it sets property to. - auto style_value = property_in_style_attribute(element, property.value()); - if (style_value.has_value()) - return style_value.value()->to_string(CSS::SerializationMode::Normal); + if (auto inline_style = element->inline_style()) { + auto value = inline_style->get_property_value(string_from_property_id(property.value())); + if (!value.is_empty()) + return value; + } // 11. If element is a font element that has an attribute whose effect is to create a presentational hint for // property, return the value that the hint sets property to. (For a size of 7, this will be the non-CSS value