1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:28:13 +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

@ -206,12 +206,9 @@ WebIDL::ExceptionOr<void> Element::set_attribute(DeprecatedFlyString const& name
return {};
}
WebIDL::ExceptionOr<void> Element::set_attribute(DeprecatedFlyString const& name, Optional<String> const& value)
WebIDL::ExceptionOr<void> Element::set_attribute(DeprecatedFlyString const& name, String const& value)
{
if (!value.has_value())
return set_attribute(name, DeprecatedString {});
return set_attribute(name, value->to_deprecated_string());
return set_attribute(name, value.to_deprecated_string());
}
// https://dom.spec.whatwg.org/#validate-and-extract