1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:18:13 +00:00

LibWeb: Port DOMException interface from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-09-06 16:03:01 +12:00 committed by Tim Flynn
parent bcb6851c07
commit 41928c2902
65 changed files with 296 additions and 296 deletions

View file

@ -72,11 +72,11 @@ WebIDL::ExceptionOr<void> NavigateEvent::intercept(NavigationInterceptOptions co
// 2. If this's canIntercept attribute was initialized to false, then throw a "SecurityError" DOMException.
if (!m_can_intercept)
return WebIDL::SecurityError::create(realm, "NavigateEvent cannot be intercepted");
return WebIDL::SecurityError::create(realm, "NavigateEvent cannot be intercepted"_fly_string);
// 3. If this's dispatch flag is unset, then throw an "InvalidStateError" DOMException.
if (!this->dispatched())
return WebIDL::InvalidStateError::create(realm, "NavigationEvent is not dispatched yet");
return WebIDL::InvalidStateError::create(realm, "NavigationEvent is not dispatched yet"_fly_string);
// 4. Assert: this's interception state is either "none" or "intercepted".
VERIFY(m_interception_state == InterceptionState::None || m_interception_state == InterceptionState::Intercepted);
@ -130,7 +130,7 @@ WebIDL::ExceptionOr<void> NavigateEvent::scroll()
// 2. If this's interception state is not "committed", then throw an "InvalidStateError" DOMException.
if (m_interception_state != InterceptionState::Committed)
return WebIDL::InvalidStateError::create(realm(), "Cannot scroll NavigationEvent that is not committed");
return WebIDL::InvalidStateError::create(realm(), "Cannot scroll NavigationEvent that is not committed"_fly_string);
// 3. Process scroll behavior given this.
process_scroll_behavior();
@ -147,15 +147,15 @@ WebIDL::ExceptionOr<void> NavigateEvent::perform_shared_checks()
// then throw an "InvalidStateError" DOMException.
auto& associated_document = verify_cast<HTML::Window>(relevant_global_object(*this)).associated_document();
if (!associated_document.is_fully_active())
return WebIDL::InvalidStateError::create(realm(), "Document is not fully active");
return WebIDL::InvalidStateError::create(realm(), "Document is not fully active"_fly_string);
// 2. If event's isTrusted attribute was initialized to false, then throw a "SecurityError" DOMException.
if (!this->is_trusted())
return WebIDL::SecurityError::create(realm(), "NavigateEvent is not trusted");
return WebIDL::SecurityError::create(realm(), "NavigateEvent is not trusted"_fly_string);
// 3. If event's canceled flag is set, then throw an "InvalidStateError" DOMException.
if (this->cancelled())
return WebIDL::InvalidStateError::create(realm(), "NavigateEvent already cancelled");
return WebIDL::InvalidStateError::create(realm(), "NavigateEvent already cancelled"_fly_string);
return {};
}