GoogleChrome / GoogleChrome/lighthouse

Don't suggest adding HTML doctype to XHTML documents

Open
#10,206 4 comments 0 reactions 0 assignees View on GitHub
docs P3
Dominant language
JavaScript
Stars
30.8k
Forks
9.8k
Avg merge
1d 14h
Merged PRs (30d)
20

Description

Given a basic `.xhtml` file, such as,
```xhtml


Test


Test


```
served with `content-type: application/xhtml+xml`, Lighthouse incorrectly reports `Page lacks the HTML doctype, thus triggering quirks mode` (https://web.dev/doctype/).

> If you serve your page as XHTML (...), you do not need a DOCTYPE to enable standards mode, as such documents always use full standards mode.

https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode

Contributor guide

Open the contributing guide

Research direction

Use the provided basic .xhtml document served as application/xhtml+xml to reproduce the warning, then inspect the Lighthouse doctype audit entry point that handles it. Done means XHTML documents no longer report a missing HTML doctype while documents that need one still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
devtools, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.