Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upKeep pipeline of "active" documents, and their JS runtime alive #22815
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The spec has a nice example of how a document of a subframe belonging to an iframe can go from
fully-activeto justactive, while a script could still keep a reference to the iframe.Currently, an "active" pipeline is closed, both in constellation and script.
The problem with this setup, besides the fact that script can still hold a reference to the document, which can result in crashes on layout(see #22507), is also that per the spec we should actually keep the tasks enqueued for the document, and run them if it becomes fully-active again(something being addressed at #22792).
There are bunch of different places where this matters, here are a few examples:
servo/components/script/script_thread.rs
Line 2551 in 481662d
clear_js_runtimewhen a pipeline is closed. Again, those should not be cancelled if the document is still active, since the tasks might still run at a later time.Zombie. The document checks this before firing load events.And I'm sure a ton of other things. So these are probably correct, and the problem is that "active" pipelines are closed. Not closing pipelines of "active" documents will take a bit of work across script and constellation.
Also, note that we can remove these from the session history to free resources, however that would require keeping some data to use to create a replacement if necessary(I guess queued tasks would need to be run on the replacement, for example).