Re: [css-font-loading] FontFaceSetLoadEvent fontfaces attribute is illegal WebIDL

On 23 Dec 2015, at 8:44 AM, Rick Byers <rbyers@chromium.org> wrote:
> 
> FontFaceSetLoadEvent is defined as <https://drafts.csswg.org/css-font-loading/#dom-fontfacesetloadevent-fontfaces>:
> 
> interface FontFaceSetLoadEvent : Event {
>   readonly attribute sequence<FontFace> fontfaces;
> };

Is that a recently added event?  I didn’t see it when I was implementing.

> But WebIDL says <https://heycam.github.io/webidl/#idl-sequence>:
> 
> Sequences must not be used as the type of an attribute or constant.
> Note: This restriction exists so that it is clear to specification writers and API users that sequences are copied rather than having references to them passed around. Instead of a writable attribute of a sequence type, it is suggested that a pair of operations to get and set the sequence is used.
> 
> I based TouchEvent constructors <https://github.com/w3c/touch-events/pull/16#issuecomment-119785062> partially on the design here, but that's causing some concern <https://github.com/w3c/touch-events/issues/54>.

I should probably update that note; there is a new pattern that can be used for exposing Arrays as property values:

  interface FontFaceSetLoadEvent : Event {
    readonly attribute FrozenArray<FontFace> fontfaces;
  };

which will cause the property to have a frozen Array object as its value.

Received on Wednesday, 23 December 2015 23:13:05 UTC