[csswg-drafts] [font-loading] document.fonts.ready promise resolution time does not match implementations

foolip has just created a new issue for https://github.com/w3c/csswg-drafts:

== [font-loading] document.fonts.ready promise resolution time does not match implementations ==
https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-readypromise-slot
https://drafts.csswg.org/css-font-loading/#switch-the-fontfaceset-to-loaded
https://drafts.csswg.org/css-font-loading/#fontfaceset-pending-on-the-environment

Per these definitions, the initial `document.fonts.ready` promise cannot resolve until "pending on the environment" is false. Making some assumptions about https://github.com/w3c/csswg-drafts/issues/1081 to clarify, this means that the promise should never resolve before the `DOMContentLoaded` event is fired.

However, as tested in Chrome, Firefox and Safari, the promise can resolve before anything else interesting happens: https://software.hixie.ch/utilities/js/live-dom-viewer/saved/4923

It might not reproduce with this test depending on network conditions, but I took it and appended a megabyte in a comment block and hosted it far away from me, and that made the promise resolve first in all 3 browsers. (Edge does not support the promise yet.)

Implementations do something different than the spec. We should figure out what it is and if that already happens to be interoperable, perhaps change the spec to say that.

EdgeHTML: @atanassov
Chromium: @kojiishi @irori @drott
Gecko: @dbaron @upsuper
WebKit: @litherum @youennf

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1082 using your GitHub account

Received on Tuesday, 7 March 2017 09:05:19 UTC