New issue
Advanced search Search tips

Issue 591602 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

document.fonts.check return 'false' for invalid font names

Project Member Reported by zhenguoou@google.com, Mar 3 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36

Steps to reproduce the problem:
Steps to reproduce:

In Firefox Version 47.0a1 (2016-03-01)
In Chrome Version 48.0.2564.116 (64-bit)

1. Open A tab in both browsers, for example:
https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/check

2. Open console and input:
document.fonts.check('italic bold 16px Invalid')

Actual results:

Firefox:
>> document.fonts.check('italic bold 16px Invalid')

<-  true

Chrome:
>> document.fonts.check('italic bold 16px Invalid')

<-  false

What is the expected behavior?
Chrome should return false in this case.

What went wrong?
When matched font face list is empty, document.fonts.check in Chrome return false instead of true.

https://drafts.csswg.org/css-font-loading/#font-face-set-check

Did this work before? No 

Chrome version: 48.0.2564.116  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 20.0 r0

For this behavior inconsistent, I also create a bug for Firefox. 
https://bugzilla.mozilla.org/show_bug.cgi?id=1252821
 
I think Chrome is not following W3C:
https://drafts.csswg.org/css-font-loading/#font-face-set-check
"
If font face list is empty, or all fonts in the font face list either have a status attribute of "loaded" or are system fonts, return true. Otherwise, return false.
"
I think Chrome's behavior is more easy to understand.

Firefox return true for non exist names make the API hard to be used. I use document.fonts.check() to check whether a font name is actually available in the platform, return true for non exist font confuse me.

Components: -Blink Blink>Fonts
Firefox is following the draft version of standard.
Chrome is following the TR version of standard.
Components: Platform>DevTools
Labels: Hotlist-Google

Comment 6 by e...@chromium.org, Mar 4 2016

Labels: Needs-Feedback
Status: Available (was: Unconfirmed)
I'm not sure how everyone keeps skipping over step 3 in the check() algorithm. >_<

If no fonts are found, step 3 requires us to *throw an error*.  We only get to return true/false if we've found at least one font.  (It's possible to find at least one face, but throw it out for having a unicode-range that makes it irrelevant. That still counts as having "found a face" - that's what the "found faces" flag is for.)

Both Firefox and Chrome are wrong currently.
Components: -Platform>DevTools
Project Member

Comment 9 by sheriffbot@chromium.org, Jul 31 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 10 by e...@chromium.org, Sep 30 2017

Status: WontFix (was: Untriaged)
Unable to repro and no further feedback.

Sign in to add a comment