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

@supports stats #19

Open
LeaVerou opened this issue Jul 15, 2020 · 2 comments
Open

@supports stats #19

LeaVerou opened this issue Jul 15, 2020 · 2 comments
Assignees
Labels
✅ Has algorithm (1/3) An implementable algorithm for how to measure this stat has been described in the issue ✅ Has JS (2/3) JS has been written to calculate this stat ✅ Has SQL (3/3) BigQuery SQL has been written to calculate this stat. proposed stat Proposed statistic to study Section: Browser support

Comments

@LeaVerou
Copy link
Owner

LeaVerou commented Jul 15, 2020

Which features are most commonly detected and with what values (if any)?

We may also want to measure CSS.supports(), its JS counterpart.

@LeaVerou LeaVerou added the proposed stat Proposed statistic to study label Jul 15, 2020
@LeaVerou LeaVerou added ⚠️ Needs SQL Needs SQL to calculate this stat ⚠️ Needs JS Needs JS to calculate this stat ⚠️ Needs algorithm labels Aug 4, 2020
@LeaVerou
Copy link
Owner Author

Let's drop CSS.supports() and values for simplicity.

We traverse rules with type: "supports". For which properties are detected, we look into rule.supports, split by and, then for each test extract:

  • whether it's negated (starts with not\s+)
  • whether it's a selector test (presence of selector before the opening paren)
  • if it's not a selector test, extract the property name ([\w-](?=[:)]) after the opening paren)

@LeaVerou LeaVerou added ✅ Has algorithm (1/3) An implementable algorithm for how to measure this stat has been described in the issue and removed ⚠️ Needs algorithm labels Aug 22, 2020
@LeaVerou LeaVerou self-assigned this Sep 12, 2020
@LeaVerou
Copy link
Owner Author

LeaVerou commented Sep 14, 2020

In the end I had to simplify a bit and drop negation, as it turns out the grammar of @supports conditionals is more tricky to parse than it seems.

The code I just pushed will only measure criteria, and not the logic that combines them (or, not etc). Also, since many times what's really tested is the value (e.g. @supports (width: min(1px, 1em))), I'm measuring the entire query, not just the property name.

@LeaVerou LeaVerou added ✅ Has JS (2/3) JS has been written to calculate this stat and removed ⚠️ Needs JS Needs JS to calculate this stat labels Sep 14, 2020
@rviscomi rviscomi added ✅ Has SQL (3/3) BigQuery SQL has been written to calculate this stat. and removed ⚠️ Needs SQL Needs SQL to calculate this stat labels Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Has algorithm (1/3) An implementable algorithm for how to measure this stat has been described in the issue ✅ Has JS (2/3) JS has been written to calculate this stat ✅ Has SQL (3/3) BigQuery SQL has been written to calculate this stat. proposed stat Proposed statistic to study Section: Browser support
Projects
None yet
Development

No branches or pull requests

2 participants