Giter Site home page Giter Site logo

Comments (9)

andydavies avatar andydavies commented on June 13, 2024

This would be easy to do using a WPT custom metric e.g.

[compat-mode]
return document.compatMode;

Here's a test I just did with it in - http://www.webpagetest.org/custom_metrics.php?test=141209_VX_91e6174f5596adc66ef6aaa019aa9eb4&run=1&cached=0

from legacy.httparchive.org.

stevesouders avatar stevesouders commented on June 13, 2024

Why would this be useful? What does it reveal?

from legacy.httparchive.org.

zcorpan avatar zcorpan commented on June 13, 2024

Why would this be useful? What does it reveal?

It is useful to research how many pages rely on a specific quirk to inform whether the quirk can be dropped from browsers, or to study pages that use a specific quirk to inform which browser's implementation is most compatible, or compatible enough, for the others to adopt. I maintain a
spec for quirks at https://quirks.spec.whatwg.org/

from legacy.httparchive.org.

stevesouders avatar stevesouders commented on June 13, 2024

I'm not sure how mainstream this is - how much it would actually be used. Can you give me a specific example?

from legacy.httparchive.org.

zcorpan avatar zcorpan commented on June 13, 2024

I can say that I've wanted this many times. Most recently checking if the -webkit-text CSS value could be removed from chromium, which only affects pages in quirks mode. That particular example gave few enough hits that it wasn't so time consuming to just manually inspect the doctype of each result, but that's not always the case.

Browsers still have many quirks that may not be necessary for web compat, so would be nice to remove, but the lack of collecting document.compatMode makes it take more time to analyse.

from legacy.httparchive.org.

zcorpan avatar zcorpan commented on June 13, 2024

I can imagine that this isn't mainstream at all; possibly it's just me who wants this. I can whip up a PR for this if I get some guidance.

from legacy.httparchive.org.

pmeenan avatar pmeenan commented on June 13, 2024

Sounds like it could easily be implemented as a custom metric (JS that runs at the end of a test). The custom metrics for HA are here.

from legacy.httparchive.org.

zcorpan avatar zcorpan commented on June 13, 2024

Thx, PR at #58

from legacy.httparchive.org.

zcorpan avatar zcorpan commented on June 13, 2024

(Documenting a workaround here...)

Query to collect pages that most likely are quirks mode (the regexp isn't as exact as the spec).

SELECT url, doctype FROM (
  SELECT
    url,
    JSON_EXTRACT(payload, '$._doctype') AS doctype,
  FROM [httparchive:har.chrome_jan_15_2016_pages]
)
WHERE doctype = '""'
OR LOWER(doctype) != '"html"'
AND REGEXP_MATCH(LOWER(doctype), r'^"([^h]|h[^t]|ht[^m]|htm[^l]|html\S|html\s+(-\/\/w3o\/\/dtd w3 html strict 3\.0\/\/en\/\/|-\/w3c\/dtd html 4\.0 transitional\/en|html|-\/\/as\/\/dtd html 3\.0 aswedit \+ extensions\/\/|-\/\/advasoft ltd\/\/dtd html 3\.0 aswedit \+ extensions\/\/|-\/\/ietf\/\/dtd html|-\/\/metrius\/\/dtd metrius presentational\/\/|-\/\/microsoft\/\/dtd internet explorer|-\/\/netscape comm\. corp\.\/\/dtd|-\/\/o\'reilly and associates\/\/dtd html|-\/\/sq\/\/dtd html 2\.0 hotmetal \+ extensions\/\/|-\/\/softquad|-\/\/spyglass\/\/dtd html 2\.0 extended\/\/|-\/\/sun microsystems corp\.\/\/dtd hotjava|-\/\/w3c\/\/dtd html 3|-\/\/w3c\/\/dtd html 4\.0 frameset\/\/|-\/\/w3c\/\/dtd html 4\.0 transitional\/\/|-\/\/w3c\/\/dtd html experimental 19960712\/\/|-\/\/w3c\/\/dtd html experimental 970421\/\/|-\/\/w3c\/\/dtd w3 html\/\/|-\/\/w3o\/\/dtd w3 html 3\.0\/\/|-\/\/webtechs\/\/dtd mozilla html|-\/\/w3c\/\/dtd html 4\.01 (frameset|transitional)\/\/\S*"|.*http:\/\/www\.ibm\.com\/data\/dtd\/v11\/ibmxhtml1-transitional\.dtd"))')

from legacy.httparchive.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.