W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Re: [css-font-loading] behaviour of setting FontFace family, style, etc. attributes

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 23 Jun 2014 15:11:44 +1000
Message-ID: <53A7B710.1000701@mcc.id.au>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
On 23/06/14 01:12, Tab Atkins Jr. wrote:
> On Sat, Jun 21, 2014 at 10:46 PM, Cameron McCormack <cam@mcc.id.au> wrote:
>> What should happen when assigning to the family, style, etc. attributes of a
>> FontFace object?  Should it be something like the FontFace constructor,
>> i.e.:
>>
>>    1. Set the status to "unloaded".  Run the remaining steps
>>       asynchronously.
>>    2. Parse the string as you would the corresponding @font-face
>>       descriptor.  If it fails to parse, reject the status promise.
>>       Otherwise, queue a task to set the attribute to the serialization
>>       of the parsed value.
>>    3. ...
>
> Fixed now. It should just be done sync, and throw TypeErrors and do
> nothing if it fails to parse.  No reason to actually unload the font.

Thanks.  I think these setters should set the attribute to the result of 
serializing the value, though, just like the constructor does. 
Otherwise you would see this:

   var f = new FontFace("blah", ..., { style: "Italic " });

   // later, once the task to set the descriptors has run:

   assert(f.style == "italic");

   f.style = "Normal ";
   assert(f.style == "Normal ")
Received on Monday, 23 June 2014 05:10:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC