mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibWeb: Handle currently ignored WebIDL::ExceptionOr<T>
s
This commit is contained in:
parent
f01d90aa63
commit
acfb546048
38 changed files with 153 additions and 149 deletions
|
@ -47,13 +47,13 @@ JS::ThrowCompletionOr<JS::Object*> ImageConstructor::construct(FunctionObject&)
|
|||
// 3. If width is given, then set an attribute value for img using "width" and width.
|
||||
if (vm.argument_count() > 0) {
|
||||
u32 width = TRY(vm.argument(0).to_u32(vm));
|
||||
image_element->set_attribute(HTML::AttributeNames::width, String::formatted("{}", width));
|
||||
MUST(image_element->set_attribute(HTML::AttributeNames::width, String::formatted("{}", width)));
|
||||
}
|
||||
|
||||
// 4. If height is given, then set an attribute value for img using "height" and height.
|
||||
if (vm.argument_count() > 1) {
|
||||
u32 height = TRY(vm.argument(1).to_u32(vm));
|
||||
image_element->set_attribute(HTML::AttributeNames::height, String::formatted("{}", height));
|
||||
MUST(image_element->set_attribute(HTML::AttributeNames::height, String::formatted("{}", height)));
|
||||
}
|
||||
|
||||
// 5. Return img.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue