Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDL mismatches spec for query() #32

Closed
domenic opened this issue Jul 21, 2020 · 5 comments
Closed

IDL mismatches spec for query() #32

domenic opened this issue Jul 21, 2020 · 5 comments

Comments

@domenic
Copy link

domenic commented Jul 21, 2020

The IDL says that query() returns a FontIterator. However the spec algorithm for query() says that it returns a Promise<FontIterator>.

@domenic
Copy link
Author

domenic commented Jul 21, 2020

Hmm, the code examples seem to treat it as if it returns a FontIterator... but I'm not sure how you'd do the algorithm that way.

I guess you could move all the asynchronous permission-checking stuff into the first invocation of "get the next iterator result", and have query() just return a not-yet-initialized object? In that case I don't think it should be a method, but instead it should be something like navigator.fonts. (See also #33.)

@annevk
Copy link

annevk commented Jul 22, 2020

This also confused me. Is there any reason this has to be an async iterator to begin with? I realize we don't want to load the individual fonts, but it seems gathering all the relevant font names + pointers to data can be done in a single request?

@jakearchibald
Copy link

I'd also like to see justification for this being an async iterator.

However, if there's good reason, I don't see an issue with the permission checking stuff happening on iteration. It's kinda nice that it can happen per iteration, as it can reject if permission is revoked.

#27 suggests we might want options to query(), or a method like matchAll(), so it might still make sense as a method rather than a property.

@jakearchibald
Copy link

Did some thinking around the async iterator stuff in #51

@jakearchibald jakearchibald mentioned this issue Oct 8, 2020
@inexorabletash
Copy link
Collaborator

No longer an async iterator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants