mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibWeb: Return empty string if image element currentSrc URL is invalid
This commit is contained in:
committed by
Andreas Kling
parent
bab086694a
commit
4f7a4d9c57
@@ -275,7 +275,10 @@ bool HTMLImageElement::complete() const
|
||||
String HTMLImageElement::current_src() const
|
||||
{
|
||||
// The currentSrc IDL attribute must return the img element's current request's current URL.
|
||||
return MUST(m_current_request->current_url().to_string());
|
||||
auto current_url = m_current_request->current_url();
|
||||
if (!current_url.is_valid())
|
||||
return {};
|
||||
return MUST(current_url.to_string());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode
|
||||
|
||||
Reference in New Issue
Block a user