1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Move DOMException from DOM/ to WebIDL/

This commit is contained in:
Linus Groh 2022-09-25 17:28:46 +01:00
parent ad04d7ac9b
commit bbaa05fcf9
49 changed files with 206 additions and 203 deletions

View file

@ -93,7 +93,7 @@ WebIDL::ExceptionOr<Attr const*> NamedNodeMap::remove_named_item(StringView qual
// 2. If attr is null, then throw a "NotFoundError" DOMException.
if (!attribute)
return NotFoundError::create(global_object(), String::formatted("Attribute with name '{}' not found", qualified_name));
return WebIDL::NotFoundError::create(global_object(), String::formatted("Attribute with name '{}' not found", qualified_name));
// 3. Return attr.
return nullptr;
@ -137,7 +137,7 @@ WebIDL::ExceptionOr<Attr const*> NamedNodeMap::set_attribute(Attr& attribute)
{
// 1. If attrs element is neither null nor element, throw an "InUseAttributeError" DOMException.
if ((attribute.owner_element() != nullptr) && (attribute.owner_element() != &associated_element()))
return InUseAttributeError::create(global_object(), "Attribute must not already be in use"sv);
return WebIDL::InUseAttributeError::create(global_object(), "Attribute must not already be in use"sv);
// 2. Let oldAttr be the result of getting an attribute given attrs namespace, attrs local name, and element.
// FIXME: When getNamedItemNS is implemented, use that instead.