Files
sousa-gecko/testing/web-platform/tests/css/css-font-loading/historical.html
T
Dileep Maurya 1f95bb3791 Bug 2048495 [wpt PR 60703] - [Fonts] Remove [LegacyNoInterfaceObject] from FontFaceSet IDL, a=testonly
Automatic update from web-platform-tests
[Fonts] Remove [LegacyNoInterfaceObject] from FontFaceSet IDL

The CSS Font Loading spec defines FontFaceSet as a regular interface
without [LegacyNoInterfaceObject] and without a constructor. Chromium's
IDL incorrectly used [LegacyNoInterfaceObject], which prevented
FontFaceSet from being exposed as a global property and deleted the
"constructor" property from the prototype.

This caused the WPT historical.html test to fail because:
1. "FontFaceSet" in self was false (not globally exposed), so the test
   fell back to document.fonts.constructor.
2. The deleted "constructor" property caused prototype chain traversal
   to EventTarget's constructor, which is callable.
3. `new document.fonts.constructor()` succeeded instead of throwing
   TypeError.

By removing [LegacyNoInterfaceObject], FontFaceSet is now properly
exposed globally. Since no constructor() is defined in the IDL, V8's
IsValidConstructorMode callback correctly throws "Illegal constructor"
(TypeError) when new FontFaceSet([]) is called from JavaScript, which
is the expected spec behavior.

This also fixes 18 FontFaceSet-related failures in the idlharness
test that were caused by the interface not being globally accessible.

Spec: https://drafts.csswg.org/css-font-loading/#fontfaceset
CSSWG Resolution: https://github.com/w3c/csswg-drafts/issues/10390

Bug: 477568263
Change-Id: I55caaf27e2bbb93918eb27b9a159dc8d92dd92b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7664980
Reviewed-by: Dan Clark <daniec@microsoft.com>
Commit-Queue: Dileep Maurya <dileepmaurya@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1648538}

--

wpt-commits: e130c537dbb488aca272c048ef0f6088c58592b2
wpt-pr: 60703
2026-06-19 20:55:33 +00:00

20 lines
499 B
HTML

<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel=help href="https://drafts.csswg.org/css-font-loading/">
<div id=log></div>
<script>
"use strict";
// https://github.com/w3c/csswg-drafts/commit/b03a8c9721b56774723ed7804ca6f3f04a922d69
test(function() {
assert_throws_js(TypeError, function() {
new FontFaceSet([]);
});
}, "FontFaceSet constructor should not be supported");
</script>