Quirksmode usage is at 15%?

10 views
Skip to first unread message

Philip Rogers

unread,
Aug 24, 2021, 12:26:03 PM8/24/21
to dom...@chromium.org
Our usecounter for quirks mode (https://chromestatus.com/metrics/feature/timeline/popularity/2034) is reporting that 15% of page loads are still using quirks mode (i.e., lack <!doctype html>). This seems unrealistic. Does it include empty documents?

Joey Arhar

unread,
Aug 24, 2021, 12:30:48 PM8/24/21
to Philip Rogers, dom-dev
about:blank, data: urls, and the initial empty state of iframe documents all return "BackCompat" in document.compatMode. I'd imagine that these (maybe not data: urls) are normally used in webpages and could cause the high usage...?

Mason Freed

unread,
Aug 24, 2021, 1:19:31 PM8/24/21
to Joey Arhar, Philip Rogers, dom-dev
What Joey said is right - mostly about:blank causes this. I changed a bunch of other standard documents to no-quirks mode (including in the spec) a while ago, so the counter maybe went down a bit from that. But it'll likely be non-web-compatible to change about:blank to standards mode.

Is there an issue behind the question? If so, we could revisit the about:blank issue.

Thanks,
Mason

Philip Rogers

unread,
Aug 24, 2021, 1:29:05 PM8/24/21
to Mason Freed, Joey Arhar, dom-dev
Thanks Joey and Mason!

The issue behind this is that I've been looking at rendering changes as part of a project to automatically find regressions. A lot of issues are found in quirks mode, and I'm wondering if our rendering changes to quirks mode really matter. From your response here, I think the answer is likely that quirks mode is actually far lower than 15% of "real" page loads.

Mason Freed

unread,
Aug 24, 2021, 2:25:44 PM8/24/21
to Philip Rogers, Joey Arhar, dom-dev
Ahh ok, thanks for the context. One note, though: it is definitely possible that real sites use JS that loads an about:blank page and then populates it with "real" content. E.g.:

  var foo = window.open('about:blank', '', '_blank');
  foo.document.write(my_content);

In this case, the document will likely (unless my_content contains a DOCTYPE) be quirks mode.

The other anecdotal case I've heard for quirks mode is typos in the <DOCTYPE> tag, or just forgetting to include it entirely.

Thanks,
Mason

Reply all
Reply to author
Forward
0 new messages