Add markupview badge when a document is in Quirks mode
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(Not tracked)
People
(Reporter: nchevobbe, Unassigned)
Details
When a page is in Quirks Mode, we show a warning message in the console (added in Bug 1238861) :
https://searchfox.org/firefox-main/rev/0a95d145f781bc57ef4183545cbb88e35d27b66d/parser/html/nsHtml5DocumentBuilder.cpp#61,73-76,90-92
void nsHtml5DocumentBuilder::SetDocumentMode(nsHtml5DocumentMode m) {
...
case QUIRKS_MODE:
mode = eCompatibility_NavQuirks;
errMsgId = "errQuirkyDoctypeVerbose";
break;
...
nsContentUtils::ReportToConsole(
nsIScriptError::warningFlag, "HTML_PARSER__DOCTYPE"_ns, mDocument,
PropertiesFile::HTMLPARSER_PROPERTIES, errMsgId);
This isn't the most visible as it 1. can be in a sea of other warnings and 2. is disconnected from the place where the user expect to find information about the page HTML (the markup view)
Polypane will have (has ?) a nice "error badge" in such case (see https://mastodon.social/@Kilian/116572981252978083 ), maybe we can do something similar
Comment 1•3 months ago
|
||
Would be nice to have a "quirks" badge next to the <html> element in the markup view.
Emilio, do you know if we have a platform API to check if a document is in quirks mode?
Comment 2•3 months ago
|
||
document.compatMode? Though that doesn't differentiate between standard and almost-standard mode: https://searchfox.org/firefox-main/rev/9c267d0a950b189974105667e9eb14d2f6172564/dom/base/Document.cpp#10795
Comment 3•2 months ago
|
||
That should be good enough to get started, thanks!
Updated•2 months ago
|
Description
•