RESOLVED FIXED 154669
CSS.supports returns false for custom properties
https://bugs.webkit.org/show_bug.cgi?id=154669
Summary CSS.supports returns false for custom properties
yisibl
Reported 2016-02-24 23:39:28 PST
1. Run CSS.supports('--foo', 'red') on the JavaScript console What is the expected result? true getting logged in the console What happens instead? false getting logged in the console As custom properties (aka CSS variables) are now supported in Chromium, CSS.supports('--foo', 'red') should return true. The alternative method signature using a conditionText works already correct and returns true for CSS.supports('(--foo: red)') The related specification can be found here: https://drafts.csswg.org/css-conditional-3/#the-css-interface See also: https://crbug.com/584683(Blink fixed)
Attachments
David Kilzer (:ddkilzer)
Comment 1 2016-08-19 12:15:05 PDT
Serg Hospodarets
Comment 2 2017-04-21 15:21:16 PDT
Serg Hospodarets
Comment 3 2017-04-21 15:47:00 PDT
The problem is, that this bug breaks most of the CSS Custom Properties detection examples across the Web. And introduces inconsistencies and confusion as it works in CSS, but not in JS.
Radar WebKit Bug Importer
Comment 4 2017-04-21 17:54:26 PDT
Ahmad Saleem
Comment 5 2022-07-30 06:39:24 PDT
I am able to reproduce this bug using test case from Comment 02 and Safari 15.6 on macOS 12.5 shows "FALSE" for "window.CSS.supports('--a', 0);" while all other browsers (Chrome Canary 106 and Firefox Nightly 105) show "TRUE". Just wanted to share updated test results. Thanks!
Ryosuke Niwa
Comment 6 2022-07-30 23:01:12 PDT
EWS
Comment 7 2022-07-31 15:53:13 PDT
Committed 252987@main (69362356a5ab): <https://commits.webkit.org/252987@main> Reviewed commits have been landed. Closing PR #2881 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.