mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 14:42:50 +02:00
LibWeb: Return empty string if object element data URL is invalid
(cherry picked from commit c61262684b51864618de99f8b302567c932455be)
This commit is contained in:
committed by
Nico Weber
parent
760fea7ffa
commit
892c6c0439
@@ -77,8 +77,11 @@ void HTMLObjectElement::form_associated_element_was_removed(DOM::Node*)
|
||||
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-object-data
|
||||
String HTMLObjectElement::data() const
|
||||
{
|
||||
auto data = get_attribute_value(HTML::AttributeNames::data);
|
||||
return MUST(document().parse_url(data).to_string());
|
||||
auto data = get_attribute(HTML::AttributeNames::data);
|
||||
if (!data.has_value())
|
||||
return {};
|
||||
|
||||
return MUST(document().parse_url(*data).to_string());
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> HTMLObjectElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
|
||||
Reference in New Issue
Block a user