Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Push temporary EC before rejecting failed image decode #436

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

awesomekling
Copy link
Member

Fixes #419

@@ -302,6 +302,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Promise>> HTMLImageElement::decode() co
return false;

auto exception = WebIDL::EncodingError::create(realm, "Current request state is broken"_fly_string);
HTML::TemporaryExecutionContext context(HTML::relevant_settings_object(*this));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a structural problem with the entire method. There's another instance in reject_if_document_not_fully_active where we could be in the deferred_invoke without having an execution context.

I think we should slap a context at the top of the queue_microtask, and the top of the deferred_invoke on 322, instead of only having it in two places. (and the context should have the callback flag set).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless it's guaranteed to have an execution context in queue_a_microtask? In which case it would only be needed in the deferred_invoke

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After staring at the code for a bit, I concluded that we (probably) need to ensure a temporary context exists in all three code paths.

@awesomekling awesomekling force-pushed the maps_crash branch 3 times, most recently from e2d1d79 to dc9b753 Compare July 5, 2024 19:21
@awesomekling awesomekling merged commit 9c80326 into LadybirdBrowser:master Jul 6, 2024
6 checks passed
@awesomekling awesomekling deleted the maps_crash branch July 6, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when loading Google Maps
2 participants