Le 04/08/2015 21:10, James Burke a écrit : > On Tue, Aug 4, 2015 at 10:06 AM, Bobby Holley <bobbyhol...@gmail.com> wrote: >> How about a scheme in which there can be N such <meta> elements, and the >> painting only happens when all of them are gone (or some timeout occurs)? >> That solve the common case that Jonas is talking about, and allows >> libraries to insert their own paint blocker into <head> if they really want >> to block painting? The a nice side-bonus of this scheme is that the >> existence of blockers is clearly visible in the DOM, so that a buggy >> library that leaves a paint blocker active is more noticeable. > If the meta tag, or whatever the toggle becomes, is set, then I expect > if the page's JS asks for a DOM element's box properties, it will get > values like 0 for sizes, since I believe the goal is to avoid the > browser doing extra work until the page's JS got everything set up. > > If that is the case, should there be a promise API for knowing when > the first layout and rendering has occurred so that the page's JS can > then ask for element box properties to get accurate values? >
If I can add a little more bit of information: in the gaia-header component we use in Gaia, we need to query measurements so that we know how much space we have to display the title, and size its font appropriately. We had to add some code so that an app can give the measurement (when it's static) instead of querying them so that we don't do sync reflows at app startup (that was bug 1112131). For sure having a promise API for this would have been really helpful. -- Julien
signature.asc
Description: OpenPGP digital signature
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform