mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:18:11 +00:00
LibWeb: Port DOMException interface from DeprecatedString to String
This commit is contained in:
parent
bcb6851c07
commit
41928c2902
65 changed files with 296 additions and 296 deletions
|
@ -561,23 +561,23 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> create_element(Document& document
|
|||
|
||||
// 5. If result’s attribute list is not empty, then throw a "NotSupportedError" DOMException.
|
||||
if (element->has_attributes())
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element cannot have attributes"sv));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element cannot have attributes"_fly_string));
|
||||
|
||||
// 6. If result has children, then throw a "NotSupportedError" DOMException.
|
||||
if (element->has_children())
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element cannot have children"sv));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element cannot have children"_fly_string));
|
||||
|
||||
// 7. If result’s parent is not null, then throw a "NotSupportedError" DOMException.
|
||||
if (element->parent())
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element cannot have a parent"sv));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element cannot have a parent"_fly_string));
|
||||
|
||||
// 8. If result’s node document is not document, then throw a "NotSupportedError" DOMException.
|
||||
if (&element->document() != &document)
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element must be in the same document that element creation was invoked in"sv));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element must be in the same document that element creation was invoked in"_fly_string));
|
||||
|
||||
// 9. If result’s local name is not equal to localName, then throw a "NotSupportedError" DOMException.
|
||||
if (element->local_name() != local_name)
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element must have the same local name that element creation was invoked with"sv));
|
||||
return JS::throw_completion(WebIDL::NotSupportedError::create(realm, "Synchronously created custom element must have the same local name that element creation was invoked with"_fly_string));
|
||||
|
||||
// 10. Set result’s namespace prefix to prefix.
|
||||
element->set_prefix(prefix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue