Closed Bug 2011628 Opened 9 months ago Closed 9 months ago

Sniff <!-- as HTML to match Chrome

Categories

(Core :: Networking, enhancement, P2)

enhancement

Tracking

()

VERIFIED FIXED
149 Branch
Tracking Status
firefox148 --- verified
firefox149 --- verified

People

(Reporter: valentin, Assigned: valentin)

References

Details

(Keywords: webcompat:platform-bug, Whiteboard: [necko-triaged], [wptsync upstream])

Attachments

(4 external files)

According to mimesniff <!-- should be followed by space or > to be sniffed as HTML. But Chrome does it regardless.
This bug is to match that behaviour (with a pref)

Pushed by valentin.gosu@gmail.com: https://github.com/mozilla-firefox/firefox/commit/f4d5c2a51c84 https://hg.mozilla.org/integration/autoland/rev/ba8b7fc9f987 Add tentative WPT for sniffing <!-- as HTML when not followed by space or > r=necko-reviewers,kershaw https://github.com/mozilla-firefox/firefox/commit/1db684dd9b7c https://hg.mozilla.org/integration/autoland/rev/621e87a0bb78 Sniff <!-- as HTML to match Chrome r=necko-reviewers,kershaw
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/57285 for changes under testing/web-platform/tests
Whiteboard: [necko-triaged] → [necko-triaged], [wptsync upstream]
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
Duplicate of this bug: 2006569
Attachment #9539358 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Webcompat issues when pages are served without a content type, and they start with a <!--comment. Note no space between !-- and the text.
    See bug 2006569.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: See bug 2006569 comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: Fixes a regression. Aligns Firefox sniffing of HTML with other browsers. Fix is really simple and behind a pref
  • String changes made/needed: none
  • Is Android affected?: yes
Attachment #9539359 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [uplift][qa-ver-needed-c149/b148]

Reproduced the issue with Firefox 148.0a1 (2025-12-17) on Windows 11. The https://ghosttogether.net/change/password webpage is displayed in html code when opened.
The issue is verified fixed with Firefox 149.0a1 (2026-01-22) on Windows 11, macOS 15 and Ubuntu 24. While the network.mimesniff.non_standard_html_comment pref it's true (as default) the https://ghosttogether.net/change/password page is correctly displayed. Turning network.mimesniff.non_standard_html_comment will reproduce the issue again.

Attachment #9539359 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9539358 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified fixed with 148.0b7 (20260125090536) build on Windows 11, macOS 14 and Ubuntu 24. While the network.mimesniff.non_standard_html_comment pref it's true (as default) the https://ghosttogether.net/change/password page is correctly displayed. Turning network.mimesniff.non_standard_html_comment to false will reproduce the issue again.

Status: RESOLVED → VERIFIED
Has STR: --- → yes
QA Whiteboard: [uplift][qa-ver-needed-c149/b148] → [uplift][qa-ver-done-c149/b148]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: