question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Work with "application/xhtml+xml" documents

See original GitHub issue

Feature request summary

When running Lighthouse, ideally it would still work with the application/xhtml+xml mime type.

https://github.com/GoogleChrome/lighthouse/blob/7d685217df0083bc69ffd2e8360ea7a75dd8dbb9/lighthouse-core/gather/gather-runner.js#L226

xhtml

What is the motivation or use case for changing this?

It should be able to continue as a normal HTML document, rather than assuming all checks have failed.

I’m not expecting it to do any additional checks (the browser would have already ensured it’s valid XML), but I’d still like it to work on my development server (I disable XML mode on Demo and Live just incase the website issues some HTML which isn’t valid XML).

How is this beneficial to Lighthouse?

Lighthouse should be able to check a HTML document that’s been served in XML mode - it’s still a perfectly good HTML document, just authored to a stricter set of rules (e.g. correct nesting of tags, all attributes have been quoted, no double use of attributes on a tag).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
patrickhulcecommented, Sep 28, 2020

Thanks for filing @craigfrancis!

Lighthouse advice is specifically targeted to HTML. Auditing an XHTML document yields several errors across Lighthouse as well as some incorrect advice, which we definitely wouldn’t want to spread. We’ve explicitly decided to limit Lighthouse to HTML. Refer to https://github.com/GoogleChrome/lighthouse/issues/10206 and https://github.com/GoogleChrome/lighthouse/issues/9245 for more discussion and reasoning.

4reactions
patrickhulcecommented, Sep 28, 2020

Understood, I agree a completely fatal run for XHTML was a bit harsh compared to say a toplevel warning to indicate non-support instead.

We can let this issue track that effort. It seems like you already started some commits working on this would you be interested in a PR that does the warning conversion? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application/xhtml+xml - Schillmania.com - Scott Schiller
XHTML is a subset of XML; in effect, "HTML with rules" in that it must be "valid" at parse time in order to...
Read more >
XHTML Media Types - Second Edition - W3C
In general, 'application/xhtml+xml' should be used for XHTML Family documents, and the use of 'text/html' should be limited to HTML -compatible ...
Read more >
RFC 3236 The 'application/xhtml+xml' Media Type - IETF
This document defines the 'application/xhtml+xml' MIME media type for XHTML based markup languages; it is not intended to obsolete any previous IETF documents, ......
Read more >
Since XHTML documents SHOULD be served as "application ...
"In summary, 'application/xhtml+xml' SHOULD be used for XHTML Family documents, and the use of 'text/html' SHOULD be limited to HTML-compatible ...
Read more >
XML Application: XHTML - Learning XML [Book] - O'Reilly
Every XHTML page is a complete XML document that conforms to the XML Version 1.0 standard, and is compatible with all general-purpose XML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found