Open Bug 2040627 Opened 3 months ago Updated 2 months ago

Add markupview badge when a document is in Quirks mode

Categories

(DevTools :: Inspector, defect, P3)

defect

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

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?

Severity: -- → S3
Flags: needinfo?(emilio)
Priority: -- → P3

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

Flags: needinfo?(emilio)

That should be good enough to get started, thanks!

Summary: Better surface pages in Quirks mode → Add markupview badge when a document is in Quirks mode
You need to log in before you can comment on or make changes to this bug.