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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 25 Jun 2014 17:54:59 -0700
Message-ID: <CAAWBYDBDkKi--CWCFE6E48y1vQpWXsMakqZaaqEfFUck+p8aiw@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: "www-style@w3.org" <www-style@w3.org>
On Sun, Jun 22, 2014 at 11:02 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> On 23/06/14 15:11, Cameron McCormack wrote:
>>
>> 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 ")
>
>
> The exception thrown when setting an invalid string (TypeError) is different
> from that thrown in the constructor (DOMException "SyntaxError"), too.  They
> should be the same.

Whoops, indeed.  Fixed both of these things to match the constructor.

~TJ
Received on Thursday, 26 June 2014 00:55:49 UTC

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