1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

LibWeb: Add Optional<String> overload for Element::set_attribute

Which for now will just call the DeprecatedString version of this
function. This is intended to be used in porting code over to using the
new String equivalent with the end goal of removing the DeprecatedString
version of this function.

This allows us to port a whole heap of IDL interfaces from
DeprecatedString to String.
This commit is contained in:
Shannon Booth 2023-09-03 01:09:33 +12:00 committed by Sam Atkins
parent d4a890080d
commit a53459192f
44 changed files with 52 additions and 43 deletions

View file

@ -337,7 +337,7 @@ WebIDL::ExceptionOr<void> Page::toggle_media_loop_state()
if (media_element->has_attribute(HTML::AttributeNames::loop))
media_element->remove_attribute(HTML::AttributeNames::loop);
else
TRY(media_element->set_attribute(HTML::AttributeNames::loop, {}));
TRY(media_element->set_attribute(HTML::AttributeNames::loop, OptionalNone {}));
return {};
}
@ -353,7 +353,7 @@ WebIDL::ExceptionOr<void> Page::toggle_media_controls_state()
if (media_element->has_attribute(HTML::AttributeNames::controls))
media_element->remove_attribute(HTML::AttributeNames::controls);
else
TRY(media_element->set_attribute(HTML::AttributeNames::controls, {}));
TRY(media_element->set_attribute(HTML::AttributeNames::controls, OptionalNone {}));
return {};
}