Re: [css-fonts] Proposal for standardizing font timeout behavior

On Thu, Oct 30, 2014 at 3:38 PM, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

> On Thu, Oct 30, 2014 at 3:03 PM, Ilya Grigorik <igrigorik@gmail.com>
> wrote:
> > On Thu, Oct 30, 2014 at 1:43 AM, John Daggett <jdaggett@mozilla.com>
> wrote:
> > This seems like an implementation issue. Personally, I'd expect the
> previous
> > headings to be re-rendered with the desired font.
>
> Whoops, I misread this example earlier; I thought it was an "optional"
> value.
>
> This is *not* an implementation issue; this will be specified by the
> spec.  The "swap" value defines that if the load completes before the
> timeout, you swap; this applies to *all* of the headings.  It also
> says that if the load completes *after* the timeout, you leave it at
> the fallback; this *also* applies to *all* of the headings.


> In other words, when a "swap" or "optional" font doesn't come in
> before the timeout, it gets an "inactive" bool set on it, which makes
> the current page treat it as not usable.  Anything else results in
> inconsistent rendering in a long document.


> (This bit of extra state should be exposed on the FontFace object, so
> you can always turn the font on manually if you want, via script.)
>

Makes sense, thanks!


> >> CSS properties have an initial value which is the same across
> >> browsers. The descriptors of the @font-face value have default
> >> values which are the same across browsers. So you need to define an
> >> initial value of the 'font-rendering' property and a default value
> >> for the 'font-rendering' descriptor within @font-face rules. In
> >> fact, to implement what you've described you need slightly different
> >> values for the property, since I think you want the default value
> >> for the descriptor to be "whatever the user agent timeout policy is"
> >> and for the *property* you want an initial value of 'auto' to mean
> >> "decide based on the 'font-rendering' descriptor value of the font".
> >
> > Gotcha, thanks for the context. However, as Brad mentioned.. couldn't
> this
> > be set via UA stylesheet?
>
> No, because (a) this is a descriptor on @font-face objects, not a
> property on elements, so it's actually impossible to put this in the
> UA stylesheet (no cascade to work with), and (b) it appears that UA
> default behavior is slightly more complex than can be expressed via
> the descriptor.  I think it's fine to UAs to have a richer set of
> behaviors by default; we don't have to expose *everything* to authors
> here, and they can do arbitrarily complex stuff with Font Loading if
> they really want to.
>

Gotcha, thanks.

Received on Thursday, 30 October 2014 23:07:03 UTC