Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

loading web fonts synchronously during automation

74 views
Skip to first unread message

Bobby Holley

unread,
Nov 4, 2015, 10:17:18 PM11/4/15
to mozilla-...@lists.mozilla.org
Right now, every wpt test includes a stylesheet with an @font-face rule to
make the 'ahem' font available to tests. Since font loading triggers a
document-wide reflow, we end up with a non-deterministic network-driven
reflow in each and every test, which makes it harder to test layout
optimizations and increases the chances for intermittent bugs.

In [1] I'm planning to add a debug flag to load web fonts synchronously,
and set that flag in the wpt runner. Please let me know if anyone has any
objections.

Cheers,
bholley

[1] https://github.com/servo/servo/pull/8341

L. David Baron

unread,
Nov 4, 2015, 10:28:55 PM11/4/15
to Bobby Holley, mozilla-...@lists.mozilla.org
On Wednesday 2015-11-04 19:16 -0800, Bobby Holley wrote:
> Right now, every wpt test includes a stylesheet with an @font-face rule to
> make the 'ahem' font available to tests. Since font loading triggers a
> document-wide reflow, we end up with a non-deterministic network-driven
> reflow in each and every test, which makes it harder to test layout
> optimizations and increases the chances for intermittent bugs.
>
> In [1] I'm planning to add a debug flag to load web fonts synchronously,
> and set that flag in the wpt runner. Please let me know if anyone has any
> objections.

The font shouldn't even load unless it's needed (i.e., there's text
that uses it). I *think* that's the way things work across
browsers, and allows inclusion of style sheets that provide a
"library" of @font-face rules that may or may not be used. That
would avoid the reflow except where Ahem is actually used, which
seems like the way things ought to work.

-David

--
𝄞 L. David Baron http://dbaron.org/ 𝄂
𝄢 Mozilla https://www.mozilla.org/ 𝄂
Before I built a wall I'd ask to know
What I was walling in or walling out,
And to whom I was like to give offense.
- Robert Frost, Mending Wall (1914)
signature.asc

Bobby Holley

unread,
Nov 4, 2015, 11:15:19 PM11/4/15
to L. David Baron, mozilla-...@lists.mozilla.org
That's a great point - I'll take a look to see how doable it is.

Bobby Holley

unread,
Nov 4, 2015, 11:28:46 PM11/4/15
to L. David Baron, mozilla-...@lists.mozilla.org
Seems generally doable, but probably more than I want to chew right now.
I'll get an issue filed though.

Does anyone object to landing the synchronous font loading as a stopgap to
get better reftest coverage until we make the font loading logic smarter?
0 new messages