Should text/media/plugin/etc documents be in quirks mode? #3113
Labels
agenda+
To be discussed at a triage meeting
compat
Standard is not web compatible or proprietary feature needs standardizing
topic: navigation
Testcases:
http://software.hixie.ch/utilities/cgi/test-tools/delayed-file?pause=0&mime=text%2Fplain&text=Am%20I%20in%20quirks%20mode?
http://software.hixie.ch/utilities/cgi/test-tools/delayed-file?pause=0&mime=image%2Fgif&text=GIF89a
http://software.hixie.ch/utilities/cgi/test-tools/delayed-file?pause=0&mime=audio/mp3&text=???
All of these are in quirks mode in Firefox, Safari, Chrome, and Edge. In the first three you can just check via the console; in Edge the console seems to be disabled on those file types, but you can use the "DOM Explorer" in devtools to add an
onclick="alert(document.compatMode)"
attribute on<body>
and then click somewhere.What happens in these cases per spec? The relevant steps for text/plain are https://html.spec.whatwg.org/#read-text and the just create a document object without ever setting its mode, as far as I can tell. Per https://dom.spec.whatwg.org/#concept-document-mode (well, the next paragraph), the default mode is "no-quirks". The tokenizer gets placed in the "PLAINTEXT state", which never hits the parts of the tokenizer that might set quirks-or-not mode. So the document should be standards mode.
Similarly, https://html.spec.whatwg.org/#read-media never sets the mode and never runs the parser, so always ends up in standards mode.
The same applies to https://html.spec.whatwg.org/#read-plugin and https://html.spec.whatwg.org/#read-ua-inline but I don't have good (esp cross-browser) testcases to exercise those.
The text was updated successfully, but these errors were encountered: