-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Discard documents and browsing contexts synchronously #14411
Description
#14262 addresses implementing document discarding, and is addressed by #14312. That implementation is asynchronous, in that script notifies the constellation when a document can be discarded, and the constellation notifies the appropriate script threads. As a result, there is a delay between discarding a document and its descendants being discarded. The spec is synchronous (https://html.spec.whatwg.org/multipage/browsers.html#discard-a-document) and does not have such a delay.
From an irc chat with @notriddle (http://logs.glob.uno/?c=mozilla%23servo&s=29+Nov+2016&e=29+Nov+2016#c570752) it looks like we can make the script thread block on the constellation when it is discarding a document without risk of deadlock. One possible solution would be to have the constellation ack a discard with the list of discarded descendants, so the script thread could then synchronously discard any ones in the same script thread.
This would address the failure seen in #13996 (#13996 (comment)). cc @Ms2ger