Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
No, Q is not the most popular physical CSS unit of length #513
I started looking into this and I'm seeing many cases where Q was detected on stylesheets with base64-encoded data. I think these are false positives triggered by a weak regex I wrote for 02_07.sql:
I reran the query with one small change: ignore any value longer than 20 characters. Most values should be small like
Q is much further down the list where we'd expect it. And the major units are mostly unchanged.
Does the CSS parser you use only give you a string for the whole value? More robust could be to use a CSS parser that gives you a list of component values, where you can iterate each component value and if it's a
It looks like the query only picks up the first length in a value when there are multiple. Right? That could miscount if pages do things like
Would also be interesting to know about typoed units and use of non-standard units (like
Yeah it's only a string value. More granular tokenization would be super useful, but not supported by this parser.
Yes! A value tokenizer would be a big help for questions like this.
You're right. I don't think it would be significant.
(And from what I've heard, tokenize() is pretty dang fast, faster than regex-based methods that people had been using before switching to my library.)