mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 16:41:52 +00:00
LibWeb: Make DOMException take error message as a String
There was no need to use FlyString for error messages, and it just caused a bunch of churn since these strings typically only existed during the lifetime of the error.
This commit is contained in:
parent
5f9a36feac
commit
175f3febb8
Notes:
github-actions[bot]
2024-10-12 19:15:13 +00:00
Author: https://github.com/awesomekling
Commit: 175f3febb8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1743
Reviewed-by: https://github.com/ADKaster
89 changed files with 464 additions and 462 deletions
|
@ -420,19 +420,19 @@ WebIDL::ExceptionOr<void> HTMLSelectElement::show_picker()
|
|||
|
||||
// 1. If this is not mutable, then throw an "InvalidStateError" DOMException.
|
||||
if (!enabled())
|
||||
return WebIDL::InvalidStateError::create(realm(), "Element is not mutable"_fly_string);
|
||||
return WebIDL::InvalidStateError::create(realm(), "Element is not mutable"_string);
|
||||
|
||||
// 2. If this's relevant settings object's origin is not same origin with this's relevant settings object's top-level origin,
|
||||
// and this is a select element, then throw a "SecurityError" DOMException.
|
||||
if (!relevant_settings_object(*this).origin().is_same_origin(relevant_settings_object(*this).top_level_origin)) {
|
||||
return WebIDL::SecurityError::create(realm(), "Cross origin pickers are not allowed"_fly_string);
|
||||
return WebIDL::SecurityError::create(realm(), "Cross origin pickers are not allowed"_string);
|
||||
}
|
||||
|
||||
// 3. If this's relevant global object does not have transient activation, then throw a "NotAllowedError" DOMException.
|
||||
// FIXME: The global object we get here should probably not need casted to Window to check for transient activation
|
||||
auto& global_object = relevant_global_object(*this);
|
||||
if (!is<HTML::Window>(global_object) || !static_cast<HTML::Window&>(global_object).has_transient_activation()) {
|
||||
return WebIDL::NotAllowedError::create(realm(), "Too long since user activation to show picker"_fly_string);
|
||||
return WebIDL::NotAllowedError::create(realm(), "Too long since user activation to show picker"_string);
|
||||
}
|
||||
|
||||
// FIXME: 4. If this is a select element, and this is not being rendered, then throw a "NotSupportedError" DOMException.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue