mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibWeb: Fix null dereference when assigning an ImageStyleValue via JS
When parsing a CSS value in the context of a CSSStyleDeclaration camelCase property setter, we don't necessarily have a Document to provide the CSS parser for context. So the parser can't go assuming that there's always a Document in the ParsingContext. And ImageStyleValue can't go assuming that there's always a Document either. This will require some more work to get things right, I'm just patching up the null dereference for now.
This commit is contained in:
@@ -55,7 +55,7 @@ void HTMLBodyElement::parse_attribute(const FlyString& name, const String& value
|
||||
if (color.has_value())
|
||||
document().set_visited_link_color(color.value());
|
||||
} else if (name.equals_ignoring_case("background")) {
|
||||
m_background_style_value = CSS::ImageStyleValue::create(document().parse_url(value), const_cast<DOM::Document&>(document()));
|
||||
m_background_style_value = CSS::ImageStyleValue::create(document().parse_url(value), &document());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user