diff options
author | Luke Wilde <lukew@serenityos.org> | 2023-03-29 01:17:38 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-29 07:10:53 +0200 |
commit | 14fb6372c354bd8e7a161ebac1ad49fc08d234f3 (patch) | |
tree | 14aef1372f0144f4d99c9a6daadc117c90e95c22 /Userland/Libraries/LibWeb/CSS | |
parent | 264b9b73ac4c47e16554f0e3c7fc8f30ceebddd9 (diff) | |
download | serenity-14fb6372c354bd8e7a161ebac1ad49fc08d234f3.zip |
LibWeb: Parse Element.style url functions relative to the document
Previously we used a parsing context with no access to the document, so
any URLs in url() functions would become invalid.
Fixes the images on Steam's store carousel, which sets
Element.style.backgroundImage to url() functions.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index a44712e99a..03ab7bbd85 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -93,7 +93,9 @@ WebIDL::ExceptionOr<void> PropertyOwningCSSStyleDeclaration::set_property(Proper return {}; // 5. Let component value list be the result of parsing value for property property. - auto component_value_list = parse_css_value(CSS::Parser::ParsingContext { realm() }, value, property_id); + auto component_value_list = is<ElementInlineCSSStyleDeclaration>(this) + ? parse_css_value(CSS::Parser::ParsingContext { static_cast<ElementInlineCSSStyleDeclaration&>(*this).element()->document() }, value, property_id) + : parse_css_value(CSS::Parser::ParsingContext { realm() }, value, property_id); // 6. If component value list is null, then return. if (!component_value_list) |