wpt / css / css-font-loading / fontface-invalid-family.tentative.html

Status: FAIL | Duration: 59ms | Subtests: 0/9 | Open test on wpt.live | wpt.fyi

Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)

SubtestStatusMessage
family: content:Segoe UIFAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: sans-serifFAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: A, BFAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: inheritFAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: a 1FAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: FAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: a bFAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: a bFAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"
family: a b FAILpromise_test: Unhandled rejection with value: object "ReferenceError: FontFace is not defined"

/css/css-font-loading/fontface-invalid-family.tentative.html

<!doctype html>
<meta charset="utf-8">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1986533">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6236">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// These are values that are invalid as a family-name, or CSS generics.
const kInvalidValues = [
  "content:Segoe UI",
  "sans-serif",
  "A, B",
  "inherit",
  "a 1",
  "",
  "a  b",
  " a b",
  "a b ",
];

for (let familyName of kInvalidValues) {
  promise_test(async function() {
    let face = new FontFace(familyName, "url('resources/Rochester.otf')");
    assert_not_equals(face.status, "error", `FontFace should be quoted after construction with invalid family name ${familyName}`);
    assert_equals(face.family, `"${familyName}"`, `FontFace.family should be the quoted string after construction with invalid family name ${familyName}`);
    await face.load();
    assert_true(true, `FontFace should load after invalid family name ${familyName} specified`);
  }, `family: ${familyName}`);
}
</script>