I can't speak about the validity of the requirement, but in terms of API, we probably want something more compositional, if several codepaths need to stop rendering. And then, we end up with the possibility that someone forgets to enable rendering, with all the ensuing debugging joy.
Since this is exactly the kind of issue we fight with Async Shutdown, I would suggest an API that looks more like document.mozLayout.addBlocker("Hey, I need to finish looking at IDB", somePromise); This will let the DevTools inspect the state, either to find out which of the blockers is slow to respond, or to find which of the blockers doesn't respond at all. Cheers, David On 30/07/15 22:20, James Burke wrote: > In talking to Wilson Page, he mentioned something like a > document.pauseLayout() document.resumeLayout(), not sure if there are > existing thoughts around that. > > If that seemed workable, maybe also a <html mozPauseLayout> type of > attribute, so the browser knows as soon as possible to pause its work, > instead of relying on a JS API. > > For Gaia apps, we use a CSP policy that does not allow inline scripts, so > the attribute on a tag is more appealing for that reason. A nonced script > might be a workable alternative for the CSP case, if an attribute was too > much of a stretch. > > Happy to hear about any suggestions for the general goal, > James > > [1] Service workers help a bit here, but do not help the other aync forces. > [2] https://bugzilla.mozilla.org/show_bug.cgi?id=863499 > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > -- David Rajchenbach-Teller, PhD Performance Team, Mozilla
signature.asc
Description: OpenPGP digital signature
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform