Bug 184532 - document.fonts.check isn't work correctly
Summary: document.fonts.check isn't work correctly
Status: RESOLVED DUPLICATE of bug 156035
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 11
Hardware: PC Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-12 05:08 PDT by David
Modified: 2022-12-01 03:15 PST (History)
8 users (show)

See Also:


Attachments
strange result (172.70 KB, image/png)
2018-04-12 05:08 PDT, David
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David 2018-04-12 05:08:53 PDT
Created attachment 337788 [details]
strange result

if you use function  `document.fonts.check` for random font name result will be `true`

document.fonts.check('12px normal ANY_RANDOM_NAME'); // return true O_o

Safari desktop 11-10
Comment 1 Radar WebKit Bug Importer 2018-04-12 07:13:50 PDT
<rdar://problem/39380289>
Comment 2 Ahmad Saleem 2022-08-06 07:16:40 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using instructions from Comment 0.

1) On this bug page, open Developer Tools and Console
2) Type - document.fonts.check('12px normal ANY_RANDOM_NAME');
3) Hit Enter and it will show "true"

I also get "true" doing same steps in Firefox Nightly 105 while only Chrome Canary 106 show "false" but this Chrome bug suggests that Chrome behavior is wrong and incorrect as per web-spec:

Link - https://bugs.chromium.org/p/chromium/issues/detail?id=591602

WHATWG Github - https://github.com/w3c/csswg-drafts/issues/5744

Appreciate if someone can comment whether we need to fix this or we can ignore this and ask Chrome to change their behavior. Thanks!
Comment 3 Sam Sneddon [:gsnedders] 2022-12-01 03:15:41 PST

*** This bug has been marked as a duplicate of bug 156035 ***