Re: [css-font-loading] values of style, variant etc. before they are initially set

On Sun, Sep 21, 2014 at 1:29 AM, Cameron McCormack <cam@mcc.id.au> wrote:
> Cameron McCormack:
>>>
>>> Why are the descriptors parsed asynchronously anyway?
>
> Tab Atkins Jr. :
>>
>> Because I was rejecting the promise when they were wrong, so it seemed
>> better to just go ahead and do all of the work async.  However, it
>> seems not worth the trouble now, or really necessary.  I've moved the
>> parsing up into the sync section instead.
>
>
> Thanks, but this still doesn't resolve the issue of what values these
> properties have before they are set -- and this is because they are only set
> if all of them parse correctly.  I think the text is also unclear about
> whether family is set if one of the descriptors in the dictionary argument
> failed to parse.
>
> What do all of these alert?
>
>   alert(new FontFace("ABC", "url(x)", { style: "x" }).style);
>   alert(new FontFace("ABC", "url(x)", { style: "x" }).family);
>   alert(new FontFace("'", "url(x)").style);
>   alert(new FontFace("'", "url(x)").family);

Sorry, missed that part.  I've now specified that if any of them fail
to parse, they all get set to the empty string, so the answer to all
of your questions is the empty string.

If it's easier, I could make it so that only the ones that fail get
set to the empty string.  Which do you prefer?

~TJ

Received on Tuesday, 23 September 2014 22:23:00 UTC