New issue
Advanced search Search tips

Issue 622660 link

Starred by 7 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Communicate that quirks mode is bad and help transition to no-quirks mode

Reported by sim...@opera.com, Jun 23 2016

Issue description

I think devtools should communicate to the developer that a page is in quirks mode (except for about:blank pages that are not interacted with), and maybe also provide tools to help transition from quirks mode to no-quirks mode.

Sometimes when people have a problem with CSS and they find removing the doctype "fixes" it, they assume that using quirks mode is the right way of doing things. I think we should communicate better that it's not.

Quirks mode has behaviors that are confusing and generally it is recommended to not use it. For example IDs and class names being case-insensitive can introduce bugs.

Ideas to communicate quirks mode being active:

* The DOM view can have an error message for the doctype (or at the top if there is no doctype).
* There could be a warning logged in the console.
* Firefox error-highlights parse errors in "view source", which highlights quirky doctypes or if the first thing is a tag instead of a doctype.

Ideas to help transition from quirks mode to no-quirks mode:

* Highlight what causes layout to be different in quirks mode. I don't have good ideas about how but I think this is what people will have the most trouble with. (Maybe highlight quirk.css UA styles in Styles tab?)
* Error-highlight CSS values in the Styles tab that are using https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk or https://quirks.spec.whatwg.org/#the-unitless-length-quirk
* Error-highlight ":active" and ":hover" selectors in Styles tab https://quirks.spec.whatwg.org/#the-active-and-hover-quirk
* Highlight <p><table> HTML parser quirk somewhere (DOM view? console?).
* etc; search for quirks in the codebase.
 

Comment 1 by sim...@opera.com, Jun 23 2016

Per httparchive data, about 7.4% (of 496,558 pages) are using quirks mode.

https://developer.mozilla.org/en-US/docs/Images,_Tables,_and_Mysterious_Gaps (which is https://quirks.spec.whatwg.org/#the-blocks-ignore-line-height-quirk ) is something that still confuses people about the no-quirks mode. (Note that a table cell is not necessary for this quirk to kick in.)

Comment 2 by r...@opera.com, Jun 23 2016

Cc: pfeldman@chromium.org

Comment 3 by sim...@opera.com, Jun 23 2016

Note that the blocks ignore line-height quirk is also present in limited-quirks mode. But document.compatMode doesn't differentiate between limited-quirks and no-quirks.

Comment 4 by sim...@opera.com, Jun 30 2016

> * The DOM view can have an error message for the doctype (or at the top if there is no doctype).

Something like this is what I had in mind.

To implement, add the message (whether or not there is a doctype) if document.compatMode === 'BackCompat'.
devtools-quirk-mockup.png
124 KB View Download

Comment 5 by mkwst@chromium.org, Jun 30 2016

Cc: ffoolip@chromium.org rbyers@chromium.org
Owner: paulir...@chromium.org
Paul, can you help triage this request into y'all's backlog?

Comment 6 by zcorpan@gmail.com, Nov 18 2016

Cc: -ffoolip@chromium.org foolip@chromium.org

Comment 7 by foolip@chromium.org, Nov 18 2016

The mockup seems pretty non-intrusive, less scary than a console message at least.

Ping Paul :)
Status: Assigned (was: Untriaged)

Sign in to add a comment