Skip to content

[font-loading] FontFaceSetLoadEvent's fontfaces should use FrozenArray #810

Description

@foolip

https://drafts.csswg.org/css-font-loading/#fontfacesetloadevent

Current IDL:

[Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict),
 Exposed=Window,Worker]
interface FontFaceSetLoadEvent : Event {
  readonly attribute sequence<FontFace> fontfaces;
};

https://heycam.github.io/webidl/#idl-sequence says "Sequences must not be used as the type of an attribute or constant" so this needs to be:

[Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict),
 Exposed=Window,Worker]
interface FontFaceSetLoadEvent : Event {
  [SameObject] readonly attribute FrozenArray<FontFace> fontfaces;
};

[SameObject] thrown in because it's true, a drive-by.

A test for this would have to check that event.fontfaces===event.fontfaces, and that new FontFaceSetLoadEvent('type', { fontfaces: x }).fontfaces!==x but that the array length and members are equal.

Lists of things are fun. @LoonyBean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions