Closed Bug 1789367 Opened 2 years ago Closed 2 years ago

document.fonts.values() not an iterable

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 104
defect

Tracking

()

RESOLVED DUPLICATE of bug 1729089

People

(Reporter: hamishwillee, Unassigned)

Details

The spec for this says it should return an iterable, and the object it returns has an iterable name. Also it is iterable on Chrome.

But Firefox 104 has a syntax error indicating that it is not. You can see this by running the example here on both platforms: https://pr19990.content.dev.mdn.mozit.cloud/en-US/docs/Web/API/CSS_Font_Loading_API#font_loading_with_events#result_2

document.fonts.ready.then(function() {
  
  log.textContent+=(`\nFontFaces in document: ${document.fonts.size}.\n`);

  for (const fontFace of document.fonts.values()) {
    log.textContent+='FontFace:\n';
    for (const property in fontFace) {
      log.textContent+=`  ${property}: ${fontFace[property]}\n`;
    }
  }
});

This is not a new issue - it appears in the intenet from around FF60:

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Component: DOM: Core & HTML → CSS Parsing and Computation
Flags: needinfo?(jfkthame)

I think Emilio was looking at this in bug 1729089.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jfkthame)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.