I'm not sure if the multiple-<meta> solution is going to be really working well.
>From the perspective of a gaia app developer that means that he has to inject
>manually a new <meta> for every library he wants to use.
That feels weird. I would rather expect a single <meta> that app controls
fully, sort of a master light switch.
Then, each library would report to the app when they're done. It could look
like this:
var readyPromises = [
L10n.init(),
Battery.init(),
Wifi.init(),
MainUI.init()
];
Promise.all(readyPromises).then(() => {
document.head.removeChild(lightSwitchElement);
});
This way library is not deciding if it's blocking displaying, it's the app
author who decides if he wants to prevent displaying until some meta is done.
===
Wrt. events, I'm on the Promise side over one-time events because the scenario
James described as "did I miss?".
So I'd love to have sth like:
document.mozFirstPaint.then();
if we're ok making this meta delay firstPaint.
===
As Wilson suggested, we may also want to add some information on what to
display until the page is painted for browser scenarios (like background color
etc.) - for gaia scenario I think we'll delay moving the window to foreground
until the promise is fulfilled.
zb.
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform