Contact emails
[email protected]<mailto:[email protected]>

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

Summary
Chromium's FontFaceSet IDL previously used [LegacyNoInterfaceObject], which hid 
FontFaceSet as a global property and deleted the constructor property from its 
prototype. This deviated from the CSS Font Loading spec and differed from 
Safari and Firefox behavior. This change removes [LegacyNoInterfaceObject] from 
the FontFaceSet IDL, so FontFaceSet is properly exposed as a global property. 
Since no constructor() is defined in the IDL, calling new FontFaceSet() from 
JavaScript now throws TypeError: Illegal constructor, matching the spec. This 
also fixes the historical.html WPT, which was previously failing in Chromium.

Blink component
Blink>Fonts<https://issues.chromium.org/issues?q=customfield1222907:%22Blink%3EFonts%22>

Web Feature ID
Font-face-set<https://webstatus.dev/features/Font-face-set>

Risks

Interoperability and Compatibility
This change removes [LegacyNoInterfaceObject] from FontFaceSet. The IDL retains 
[Exposed=(Window,Worker)] and defines no constructor. This aligns Chromium with 
the CSS Font Loading spec (per CSSWG resolution w3c/csswg-drafts#10390), with 
Firefox and WebKit.

Observable changes for web content:
    1. FontFaceSet is exposed as a property of Window and Worker globals: 
typeof FontFaceSet changes from "undefined" to "function", and "FontFaceSet" in 
self changes from false to true.
    2. new FontFaceSet(...) throws TypeError: Illegal constructor; previously 
it threw ReferenceError: FontFaceSet is not defined.
    3. document.fonts.constructor returns FontFaceSet; previously 
prototype-chain traversal reached EventTarget because [LegacyNoInterfaceObject] 
removed FontFaceSet.prototype.constructor. As a consequence, new 
document.fonts.constructor(...) previously constructed an EventTarget and now 
throws TypeError: Illegal constructor.

Compatibility risk is low.
No pre-change code path in Chromium produced a FontFaceSet instance: the 
literal new FontFaceSet(...) threw ReferenceError, and the prototype-walk path 
new document.fonts.constructor(...) produced an EventTarget. Access to the 
existing FontFaceSet instance via document.fonts is unchanged. The 
historical.html WPT and 18 FontFaceSet sub-tests in 
css/css-font-loading/idlharness.https.html move from failing to passing.

        Gecko: Shipped/Shipping
        (https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet)
        Firefox has long exposed FontFaceSet as a global without a constructor.

        WebKit: Shipped/Shipping
        (https://bugs.webkit.org/show_bug.cgi?id=276794)

        Web developers: No signals

Security
Low risk.
No new APIs, no new attack surface, and no changes to cross-origin behavior or 
font loading lifecycle.


Debuggability
No changes to DevTools.
Existing behavior (TypeError for constructor usage) remains unchanged and 
debuggable.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, 
ChromeOS, Android, and Android WebView)?
Yes
Supported uniformly across all platforms.

Is this feature fully tested by 
web-platform-tests<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>?
Yes
https://wpt.fyi/results/css/css-font-loading/historical.html



Tracking bug
https://issues.chromium.org/issues/477568263

Estimated milestones
Shipping on desktop
151
Shipping on Android
151
Shipping on WebView
151
Shipping on iOS
151


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5123999844663296

This intent message was generated by Chrome Platform 
Status<https://chromestatus.com/>.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/SE3P153MB189319FFE3BAA4AA2513C9F7C3E42%40SE3P153MB1893.APCP153.PROD.OUTLOOK.COM.

Reply via email to