v151 · web platform · fonts
Remove [LegacyNoInterfaceObject] from FontFaceSet IDL
Chrome previously used [LegacyNoInterfaceObject] on FontFaceSet, hiding it as a global and deleting its constructor. This change exposes FontFaceSet globally — aligning with the CSS Font Loading spec and Firefox/Safari.
concepts
-
Interface-Object Probe
Evaluate the exact expressions this change affects —
typeof FontFaceSet,document.fonts instanceof FontFaceSet,FontFaceSet.prototype.check— and see live what your browser returns in a pass/fail table. -
instanceof Guards
Exposing the interface object is what makes
value instanceof FontFaceSetlegal. Run a real type-guard againstdocument.fonts, aFontFace, a plainSet, and more — the check that used to throw aTypeErrornow works. -
Live Font Loader
Exercise the
FontFaceSetAPI whose type is now nameable:check(),ready, iterate the set, and dynamicallyload()andadd()a newFontFaceat runtime.
why it shipped
[LegacyNoInterfaceObject] is a legacy Web IDL escape hatch that keeps an interface's constructor off the global object. It made FontFaceSet un-nameable in Chrome — you could hold one via document.fonts but never write instanceof FontFaceSet or reach FontFaceSet.prototype. Firefox and Safari already exposed it; removing the attribute aligns Chrome with them and with the CSS Font Loading specification, and unblocks precise instanceof type guards in libraries.