Skip to content

Fix microtask checkpoint #32003

@gterzian

Description

@gterzian

Follow-up to #31505

Currently, we perform_a_microtask_checkpoint after the handling of each "sequential" message in the script-thread. This includes various types of messages.

As per the spec, a microtask checkpoint should only be run after running a task, which corresponds to MainThreadScriptMsg::Common(CommonScriptMsg::Task().

I've tried only running those after a task, and got some unexpected test results, so this requires more investigation. For example, if we call into javascript at any point when handling those "other types of message", for example by firing an event, we are sort of running a task and need to perform a microtask checkpoint afterwards. I assume we are indeed doing this, and that this is why it is necessary to run the microtask checkpoint after having handled any type of message.

A potential solution would be to queue a task, and only from within the task calling into JS. But this needs to be determined on a case by case basis, based on the spec or if absent, common sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions