mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +00:00
LibWeb: Return DOMException instead of crashing when setting attributes
This commit is contained in:
parent
6891676fce
commit
5d3b7a5ecc
Notes:
sideshowbarker
2024-07-16 19:42:24 +09:00
Author: https://github.com/PrestonLTaylor
Commit: 5d3b7a5ecc
Pull-request: https://github.com/SerenityOS/serenity/pull/19044
24 changed files with 57 additions and 51 deletions
|
@ -168,9 +168,9 @@ unsigned HTMLImageElement::width() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
void HTMLImageElement::set_width(unsigned width)
|
||||
WebIDL::ExceptionOr<void> HTMLImageElement::set_width(unsigned width)
|
||||
{
|
||||
MUST(set_attribute(HTML::AttributeNames::width, DeprecatedString::number(width)));
|
||||
return set_attribute(HTML::AttributeNames::width, DeprecatedString::number(width));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-height
|
||||
|
@ -196,9 +196,9 @@ unsigned HTMLImageElement::height() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
void HTMLImageElement::set_height(unsigned height)
|
||||
WebIDL::ExceptionOr<void> HTMLImageElement::set_height(unsigned height)
|
||||
{
|
||||
MUST(set_attribute(HTML::AttributeNames::height, DeprecatedString::number(height)));
|
||||
return set_attribute(HTML::AttributeNames::height, DeprecatedString::number(height));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-naturalwidth
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue