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

"_quirks_mode" metric is always false #186

Closed
zcorpan opened this issue Dec 12, 2019 · 9 comments
Closed

"_quirks_mode" metric is always false #186

zcorpan opened this issue Dec 12, 2019 · 9 comments

Comments

@zcorpan
Copy link

zcorpan commented Dec 12, 2019

In HTTPArchive/legacy.httparchive.org#58 we introduced a custom metric to record document.compatMode. I think it has been working in the past, but now it appears to be false for all pages.

SELECT url FROM `httparchive.pages.2019_11_01_desktop` WHERE STRPOS(payload, '"_quirks_mode":false') > 0

Lots of results.

SELECT url FROM `httparchive.pages.2019_11_01_desktop` WHERE STRPOS(payload, '"_quirks_mode":true') > 0

No results.

I wanted this metric now to research whatwg/quirks#48 😐

@rviscomi
Copy link
Member

Are there any example pages that return BackCompat that we can test this with? Are there other methods of detecting quirks mode, like the doctype, that can be parsed from the HTML body?

@zcorpan
Copy link
Author

zcorpan commented Dec 12, 2019

HTTPArchive/legacy.httparchive.org#40 (comment) has a query that still works with newer dataset.

I ran it now on httparchive.pages.2019_11_01_desktop resulting in 209,037 pages.

https://docs.google.com/spreadsheets/d/14-44npYPWVgdPQyMzIhdfD1m3UTEsqOSnH93rPNHbi4/edit?usp=sharing

@zcorpan
Copy link
Author

zcorpan commented Dec 12, 2019

I think that result misses out pages that have no doctype at all.

Running a query for WHERE doctype IS NULL gives only 39 results, which seems way too low to represent the number of pages without a doctype.

@zcorpan
Copy link
Author

zcorpan commented Dec 12, 2019

No wait, there's a whole bunch of rows with "" which probably means no doctype.

@rviscomi
Copy link
Member

rviscomi commented Jul 7, 2020

@zcorpan can we close this?

@zcorpan
Copy link
Author

zcorpan commented Jul 8, 2020

No, we should either fix the metric so it works again or remove it.

The original implementation is here

https://github.com/HTTPArchive/legacy.httparchive.org/blob/master/custom_metrics/quirks_mode.js

That repo is now marked legacy. Should it be moved somewhere else?

@rviscomi
Copy link
Member

rviscomi commented Jul 8, 2020

Here's a query that looks at all values of the custom metric:

SELECT
  JSON_EXTRACT(payload, '$._quirks_mode') AS q,
  COUNT(0) AS n
FROM
  `httparchive.pages.2020_06_01_mobile`
GROUP BY
  q
q n
  100
1 238849
false 5494475

For some reason the JSON encoding of true is being converted to 1, but according to these results it does seem like there are some pages that are in quirks mode.

@zcorpan
Copy link
Author

zcorpan commented Jul 10, 2020

Ooh, so it is working then. Great! Thanks @rviscomi

@zcorpan zcorpan closed this as completed Jul 10, 2020
@zcorpan
Copy link
Author

zcorpan commented Jul 10, 2020

So per this metric, ~4.17% of pages are in quirks mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants