mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:02:43 +00:00 
			
		
		
		
	LibWeb: Make factory method of HTML::PageTransitionEvent fallible
This commit is contained in:
		
							parent
							
								
									97b5aa56da
								
							
						
					
					
						commit
						d9845bb24b
					
				
					 3 changed files with 7 additions and 7 deletions
				
			
		|  | @ -9,12 +9,12 @@ | ||||||
| 
 | 
 | ||||||
| namespace Web::HTML { | namespace Web::HTML { | ||||||
| 
 | 
 | ||||||
| PageTransitionEvent* PageTransitionEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) | WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> PageTransitionEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) | ||||||
| { | { | ||||||
|     return realm.heap().allocate<PageTransitionEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors(); |     return MUST_OR_THROW_OOM(realm.heap().allocate<PageTransitionEvent>(realm, realm, event_name, event_init)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| PageTransitionEvent* PageTransitionEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) | WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> PageTransitionEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init) | ||||||
| { | { | ||||||
|     return create(realm, event_name, event_init); |     return create(realm, event_name, event_init); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -18,8 +18,8 @@ class PageTransitionEvent final : public DOM::Event { | ||||||
|     WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event); |     WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event); | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|     static PageTransitionEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); |     static WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> create(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); | ||||||
|     static PageTransitionEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); |     static WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); | ||||||
| 
 | 
 | ||||||
|     PageTransitionEvent(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); |     PageTransitionEvent(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -789,7 +789,7 @@ void Window::fire_a_page_transition_event(DeprecatedFlyString const& event_name, | ||||||
|     // with the persisted attribute initialized to persisted,
 |     // with the persisted attribute initialized to persisted,
 | ||||||
|     HTML::PageTransitionEventInit event_init {}; |     HTML::PageTransitionEventInit event_init {}; | ||||||
|     event_init.persisted = persisted; |     event_init.persisted = persisted; | ||||||
|     auto event = HTML::PageTransitionEvent::create(associated_document().realm(), event_name, event_init); |     auto event = HTML::PageTransitionEvent::create(associated_document().realm(), event_name, event_init).release_value_but_fixme_should_propagate_errors(); | ||||||
| 
 | 
 | ||||||
|     // ...the cancelable attribute initialized to true,
 |     // ...the cancelable attribute initialized to true,
 | ||||||
|     event->set_cancelable(true); |     event->set_cancelable(true); | ||||||
|  | @ -798,7 +798,7 @@ void Window::fire_a_page_transition_event(DeprecatedFlyString const& event_name, | ||||||
|     event->set_bubbles(true); |     event->set_bubbles(true); | ||||||
| 
 | 
 | ||||||
|     // and legacy target override flag set.
 |     // and legacy target override flag set.
 | ||||||
|     dispatch_event(*event); |     dispatch_event(event); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/#dom-queuemicrotask
 | // https://html.spec.whatwg.org/#dom-queuemicrotask
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kenneth Myhra
						Kenneth Myhra