Skip to content

[css-font-loading] document.fonts vs. self.fonts distinction is annoying; consider defining window.fonts #7178

@domenic

Description

@domenic

https://andreubotella.com/csswg-auto-build/css-font-loading-3/#font-face-source

It is annoying that if you want to write code that works in both a window or worker context, you have to do (self.fonts || document.fonts).load(...).

It would be better if you could do fonts.load(...).

I propose that window.fonts be added as an alias for document.fonts, and all the examples be updated to steer people toward fonts instead of document.fonts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions