Closed Bug 1636607 Opened 4 years ago Closed 4 years ago

some DOCTYPEs that should lead to limited-quirks mode lead to no-quirks mode

Categories

(Core :: DOM: HTML Parser, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox-esr78 79+ fixed
firefox78 --- wontfix
firefox79 --- fixed

People

(Reporter: dbaron, Assigned: hsivonen)

Details

Attachments

(3 files)

I was just writing a test to file bug 1636606 and I noticed that we don't match the spec's rules for determining when to be in limited-quirks mode, whereas Chromium does.

In particular, the spec that currently says:

Otherwise, if the document is not an iframe srcdoc document, and the DOCTYPE token matches one of the conditions in the following list, then set the Document to limited-quirks mode:

  • [...]
  • The system identifier is not missing and the public identifier starts with: "-//W3C//DTD HTML 4.01 Transitional//"

It appears that, instead of the test:

the public identifier starts with: "-//W3C//DTD HTML 4.01 Transitional//"
we behave as though the spec had said:
the public identifier is: "-//W3C//DTD HTML 4.01 Transitional//EN"

Chromium appears to follow the spec.

While I'd perhaps have preferred that the spec match our behavior, it doesn't, and it seems like it might be worth aligning with the spec on this case (and probably other similar cases).

In those testcases, the difference between no-quirks mode and limited-quirks mode is whether the "hello" "hello" lines are stuck together (limited-quirks or quirks) or spaced apart (no-quirks mode). Everything else should be the same between no-quirks and limited-quirks.

Severity: -- → S3

The almost quirks list changed to prefix match at the same time as the quirks list:
https://searchfox.org/whatwg-html/diff/9345b201261c452868a68780ece85370f17644a3/source#42357

Yet, I somehow failed to make the change to the almost standard check at the time.

Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5def8ccd9388
Use prefix match for public identifiers that trigger the Almost Standards Mode. r=alchen
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

Comment on attachment 9147261 [details]
Bug 1636607 - Use prefix match for public identifiers that trigger the Almost Standards Mode.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Some pages in the long tail of the legacy Web will get the wrong rendering mode.
  • User impact if declined: Layout/styling of pages may look slightly broken.
  • Fix Landed on Version: 79
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Merely changes exact match to prefix match.
  • String or UUID changes made by this patch: None.
Attachment #9147261 - Flags: approval-mozilla-esr78?

Comment on attachment 9147261 [details]
Bug 1636607 - Use prefix match for public identifiers that trigger the Almost Standards Mode.

Improves web compat for legacy sites. Approved for 78.1esr.

Attachment #9147261 - Flags: approval-mozilla-esr78? → approval-mozilla-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: