Display an error when a page is in Quirks mode
Categories
(DevTools :: Console, enhancement, P3)
Tracking
(firefox96 fixed)
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: rik, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
(Whiteboard: dt-webcompat)
Attachments
(3 files)
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment 3•7 years ago
|
||
Assignee | ||
Comment 4•7 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Another use case for webcompat.
Spending a lot of time to try to diagnose and understand a different behavior in between Blink/WebKit and Gecko, then to discover later that the document was in Quirks Mode.
Sending a warning in the console or showing a red flag on the wrong doctype or lack of doctype, would allow us
- save time for diagnosis
- encourage web developers to switch to standard mode, hence have more compatible web pages.
see for example https://github.com/webcompat/web-bugs/issues/66747
Updated•4 years ago
|
Note that Firefox already logs a console warning when <meta charset> is missing. A similar kind of warning could be logged in case of quirks mode.
Assignee | ||
Comment 7•4 years ago
|
||
Henri, would you know from where we could emit such message ? This seems like a potential place https://searchfox.org/mozilla-central/rev/3f97afc8db535f9b0232222cb48cc4cbf8334c76/parser/html/nsHtml5DocumentBuilder.cpp#91-93 but I'm not sure this handles non html5 documents?
The relevant place is in https://searchfox.org/mozilla-central/rev/3f97afc8db535f9b0232222cb48cc4cbf8334c76/parser/html/nsHtml5TreeBuilderCppSupplement.h#1385
The parser with "nsHtml5" in the name is used for all text/html
, except about:blank
.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
This patch is reusing the errAlmostStandardsDoctype and errQuirkyDoctype strings
to display an error message in the webconsole.
A webconsole mochitest is added in the following patch of this stack.
Assignee | ||
Comment 10•3 years ago
|
||
In the previous patch of this stack, we started to emit error messages for
documents with non-standards doctype.
This patch makes it so we also add a Learn More link to the MDN page about
doctype modes, and adds a test to check that everything is displayed as
we expect.
Depends on D131889
Updated•3 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
The new warning message was messing up with some tests using doctype-less pages.
Depends on D131890
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6e416679c215
https://hg.mozilla.org/mozilla-central/rev/c025cb7c3946
https://hg.mozilla.org/mozilla-central/rev/9ac235edd25f
Comment 14•3 years ago
|
||
Can we exclude about:blank?
Some Thunderbird tests are failing (due to the console warning) for about:blank being in quirks mode.
https://treeherder.mozilla.org/logviewer?job_id=360200830&repo=comm-central&lineNumber=5361
Comment 15•3 years ago
|
||
Check webconsole metrics, we are now loading 70 more modules, see https://treeherder.mozilla.org/perfherder/comparesubtest?framework=12&originalProject=autoland&originalSignature=3765730&newProject=autoland&newSignature=3765730&originalRevision=394b3415b476edd81fc8728abb82c25ded4a7d16&newRevision=356c521826254fbae435b212923b20801d171950&page=1
I want to run the test and check which modules are now loaded.
Comment 16•3 years ago
|
||
Here's the diff of newly loaded modules:
resource://devtools/client/shared/source-utils.js
resource://devtools/client/webconsole/components/Output/MessageContainer.js
resource://devtools/client/webconsole/components/Output/message-types/ConsoleApiCall.js
resource://devtools/client/webconsole/components/Output/GripMessageBody.js
resource://devtools/client/webconsole/utils/object-inspector.js
resource://devtools/client/shared/components/reps/index.js
resource://devtools/client/shared/components/reps/reps/constants.js
resource://devtools/client/shared/components/reps/reps/rep.js
resource://devtools/client/shared/components/reps/reps/undefined.js
resource://devtools/client/shared/components/reps/reps/rep-utils.js
resource://devtools/client/shared/components/reps/reps/null.js
resource://devtools/client/shared/components/reps/reps/string.js
resource://devtools/client/shared/components/reps/reps/number.js
resource://devtools/client/shared/components/reps/reps/array.js
resource://devtools/client/shared/components/reps/reps/object.js
resource://devtools/client/shared/components/reps/reps/prop-rep.js
resource://devtools/client/shared/components/reps/reps/symbol.js
resource://devtools/client/shared/components/reps/reps/infinity.js
resource://devtools/client/shared/components/reps/reps/nan.js
resource://devtools/client/shared/components/reps/reps/accessor.js
resource://devtools/client/shared/components/reps/reps/accessible.js
resource://devtools/client/shared/components/reps/reps/attribute.js
resource://devtools/client/shared/components/reps/reps/big-int.js
resource://devtools/client/shared/components/reps/reps/date-time.js
resource://devtools/client/shared/components/reps/reps/document.js
resource://devtools/client/shared/components/reps/reps/document-type.js
resource://devtools/client/shared/components/reps/reps/event.js
resource://devtools/client/shared/components/reps/reps/grip.js
resource://devtools/client/shared/components/reps/reps/function.js
resource://devtools/client/shared/components/reps/reps/promise.js
resource://devtools/client/shared/components/reps/reps/regexp.js
resource://devtools/client/shared/components/reps/reps/stylesheet.js
resource://devtools/client/shared/components/reps/reps/comment-node.js
resource://devtools/client/shared/components/reps/shared/dom-node-constants.js
resource://devtools/client/shared/components/reps/reps/element-node.js
resource://devtools/client/shared/components/reps/reps/text-node.js
resource://devtools/client/shared/components/reps/reps/error.js
resource://devtools/client/shared/components/reps/reps/window.js
resource://devtools/client/shared/components/reps/reps/object-with-text.js
resource://devtools/client/shared/components/reps/reps/object-with-url.js
resource://devtools/client/shared/components/reps/reps/grip-array.js
resource://devtools/client/shared/components/reps/shared/grip-length-bubble.js
resource://devtools/client/shared/components/reps/reps/grip-map.js
resource://devtools/client/shared/components/reps/reps/grip-map-entry.js
resource://devtools/client/shared/components/object-inspector/index.js
resource://devtools/client/shared/components/object-inspector/components/ObjectInspector.js
resource://devtools/client/shared/components/object-inspector/actions.js
resource://devtools/client/shared/components/object-inspector/utils/load-properties.js
resource://devtools/client/shared/components/object-inspector/utils/client.js
resource://devtools/client/shared/components/object-inspector/utils/node.js
resource://devtools/client/shared/components/object-inspector/reducer.js
resource://devtools/client/shared/components/Tree.js
resource://devtools/client/shared/components/object-inspector/components/ObjectInspectorItem.js
resource://devtools/client/shared/components/object-inspector/utils/index.js
resource://devtools/client/shared/components/object-inspector/utils/selection.js
resource://devtools/client/webconsole/components/Output/ConsoleTable.js
resource://devtools/client/webconsole/components/Output/Message.js
resource://devtools/client/webconsole/components/Output/MessageIndent.js
resource://devtools/client/webconsole/components/Output/MessageIcon.js
resource://devtools/client/shared/components/Frame.js
resource://devtools/client/webconsole/components/Output/message-types/ConsoleCommand.js
resource://devtools/client/webconsole/components/Output/message-types/CSSWarning.js
resource://devtools/client/webconsole/components/Output/message-types/DefaultRenderer.js
resource://devtools/client/webconsole/components/Output/message-types/EvaluationResult.js
resource://devtools/client/webconsole/components/Output/message-types/NetworkEventMessage.js
resource://devtools/client/netmonitor/src/utils/mdn-utils.js
resource://devtools/client/webconsole/components/Output/message-types/PageError.js
resource://devtools/client/webconsole/components/Output/message-types/SimpleTable.js
resource://devtools/client/webconsole/components/Output/message-types/WarningGroup.js
I noticed we are almost not using lazy loading in shared/components and in webconsole/components. Maybe it would be worth filing a bug to use lazy loading and fix the performance regression?
Comment 17•3 years ago
|
||
Assignee | ||
Comment 18•3 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #14)
Can we exclude about:blank?
Some Thunderbird tests are failing (due to the console warning) for about:blank being in quirks mode.
https://treeherder.mozilla.org/logviewer?job_id=360200830&repo=comm-central&lineNumber=5361
That would make sense. I wonder if we could exclude other pages (about:*
, view-source:
, …)
Description
•