New issue
Advanced search Search tips

Issue 600137 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 506869
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Feature



Sign in to add a comment

CSS.supports() not working for font-display

Reported by superpoi...@gmail.com, Apr 2 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36

Steps to reproduce the problem:
1. Turn on experimental web-platform features in Canary
2. Open Developer Tools Console
3. type CSS.supports("font-display", "swap"); and enter

What is the expected behavior?
Should have displayed true. In my tests font-display works but not feature detection using CSS.supports()

What went wrong?
CSS.supports() showing false 

Did this work before? N/A 

Chrome version: 51.0.2697.0  Channel: stable
OS Version: 6.2 (Windows 8)
Flash Version: Shockwave Flash 21.0 r0

Feature works, feature-detection via javascript isn't
 
CSS supports.png
16.4 KB View Download
Components: -Blink Blink>CSS

Comment 2 by suzyh@chromium.org, Apr 6 2016

Labels: -Type-Bug -Pri-2 Pri-3 Type-Feature
Owner: ksakamoto@chromium.org
Status: Assigned (was: Unconfirmed)
Confirmed, as best I can tell. I'm on Linux, in Chrome unstable with experimental web platform features enabled. http://output.jsbin.com/nigahi/latest/quiet shows different fonts for the five lines but CSS.supports("font-display", "swap"); returns false. Assigning to ksakamoto as owner listed at https://www.chromestatus.com/feature/4799947908055040.
Mergedinto: 506869
Status: Duplicate (was: Assigned)
This is actually working as intended. font-display is a descriptor, not a property, and CSS.supports is only for properties (there is both a font-family descriptor and font-family property so it works in CSS.supports).

https://drafts.csswg.org/css-conditional-3/#the-css-interface
https://tabatkins.github.io/specs/css-font-display/#font-display-desc
Thanks. If CSS.supports won't do feature detection, what else does it?

There may be cases where it's useful. 

For example, if the browser supports font-display I'd use the browser's feature. Else I'll run fontfaceobserver which can be made to behave like font-display. 
Should `font-display` be exposed in the CSS Font Loading API?

I filed an issue at tab’s github but I think maybe I should file it here: 
https://github.com/tabatkins/specs/issues/54
I think we should reopen this. Is there a practical reason why CSS.supports and @supports shouldn’t work with descriptors?

Sign in to add a comment