loading web fonts synchronously during automation

Showing 1-4 of 4 messages
loading web fonts synchronously during automation Bobby Holley 11/4/15 7:17 PM
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
Re: loading web fonts synchronously during automation L. David Baron 11/4/15 7:28 PM
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)
Re: loading web fonts synchronously during automation Bobby Holley 11/4/15 8:15 PM
That's a great point - I'll take a look to see how doable it is.
Re: loading web fonts synchronously during automation Bobby Holley 11/4/15 8:28 PM
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?