1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

LibWeb: Remove Element::set_attribute(name, value?)

That API came from a mistake in the IDL compiler, where reflected
nullable attributes would try to call set_attribute(name, null).
This commit fixes the mistake in the IDL generator, and removes the
meaningless API.
This commit is contained in:
Ali Mohammad Pur 2023-10-13 23:06:47 +03:30 committed by Tim Flynn
parent d2c7e1ea7d
commit 988c6568a9
4 changed files with 20 additions and 11 deletions

View file

@ -358,7 +358,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, OptionalNone {}));
TRY(media_element->set_attribute(HTML::AttributeNames::loop, {}));
return {};
}
@ -374,7 +374,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, OptionalNone {}));
TRY(media_element->set_attribute(HTML::AttributeNames::controls, {}));
return {};
}