Re: [csswg-drafts] [font-loading] "pending on the environment" not clear about what "document is still loading" means (#1081)

> It's unclear at which point relative to setting ready state, firing DOMContentLoaded or load event, this timing falls into etc...

I think it's the "load" event - that waits until after stylesheets finish loading, right? Point of that condition is that you know all the styles that might cause a font to be requested.

> Should we be going back & forth between not pending on the environment & pending on the environment?

Yes, you definitely go back and forth, and the spec has a note specifically calling out the fact that `.ready()` can return different promises across invocations due to this (if it went to "not pending" and resolved, and then more stuff happened which switched it back to "pending").

> Finally, the third bullet point has a reference to undefined the concept of pending layout operations. I don't even know what that means.

Yup, style application and layout don't have good or precise terminology attached to them, unfortunately. I was forced to be handwavey here.

It's definitely *later than* when all computed styles are resolved, since it talks about layout; it thus can never happen before a *layout* finishes (to satisfy the guarantee talked about in the following note). The point is just that, if you wait for the ready promise to fulfill and then immediately go measure sizes/positions of things, you're not going to get burned by things resizing in the next frame or two due to fonts loading in.

Hm, I do suppose that an animation can change the 'font-family' being used. I'm happy to clarify that those shouldn't be considered, I guess.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1081#issuecomment-579553459 using your GitHub account

Received on Wednesday, 29 January 2020 01:36:54 UTC