Skip to content

Should text/media/plugin/etc documents be in quirks mode? #3113

Closed

Description

@bzbarsky

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.

Activity

  1. added
    topic: navigation
    on Oct 10, 2017
  2. added
    compat
    on Jan 30, 2020
  3. added
    agenda+
    on May 26, 2021
  4. added a commit that references this issue on Jun 24, 2021
    0564169
  5. added a commit that references this issue on Jun 3, 2022
    86f7d67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agenda+compattopic: navigation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions