Skip to page content or skip to Accesskey List.
Search evolt.org
evolt.org login: or register

Work

Main Page Content

New DOCTYPE sniffing in upcoming Mozilla releases

Rated 4.26 (Ratings: 8) (Add your rating)

Log in to add a comment
(9 comments so far)

Want more?

 
Picture of bmason

Bill Mason

Member info | Full bio

User since: October 10, 2000

Last login: April 15, 2007

Articles written: 5

The Mozilla browser, like several other browsers on the market, uses DOCTYPE sniffing to determine how to render a page. In Mozilla's case, it either renders the page strictly, in "standards mode," or more loosely -- otherwise known as "quirks mode." Now Mozilla introduces something more.

Almost Standards

In the upcoming 1.01 and 1.1 releases, Mozilla will add an "almost standards" mode to its mix. This mode is virtually identical to the standards mode (now being referred to as "full standards mode") but with one crucial change. In almost standards mode, Mozilla will not implement the CSS-2 line-height rules that causes many pages with pixel-precise image layouts via tables to break apart.

DOCTYPE Changes

Several DOCTYPEs that formerly triggered full standards mode will now render in almost standards mode. Those DOCTYPEs are:

  • XHTML 1.0 Transitional
  • XHTML 1.0 Frameset
  • HTML 4.01 Transitional with a system identifier URL in the DOCTYPE
  • HTML 4.01 Frameset with a system identifier URL in the DOCTYPE
  • One particular system DOCTYPE as a concession to some specific needs of IBM (all other system DOCTYPEs render in full standards mode).

Reference material

Front-end web development (mostly) and an interest/focus in web accessibility. I also recently co-authored my first book, The Web Professional's Handbook, published by the late great glasshaus.

I've been out of work since October 2001. Be kind and glance over my portfolio....

One Step Forward, Two Steps Back?

Submitted by jaylard on July 3, 2002 - 09:40.

As a vocal critic of Mozilla's implementation of line-height rules within tables, I am pleased that the Mozilla team is softening its dogmatic interpretation of the CSS 2 recommendation on this point, and appears willing to accommodate the prevailing interpretation. But one has to ask -- I have to ask -- whether creating yet another rendering mode is the best way to do this?

I'm curious: why this change now? It would have been far better had this change been folded into its standards-compliant mode prior to Mozilla's 1.0 release. But by creating a third rendering mode in order to accommodate this change, the Mozilla team apparently continues to insist that its interpretation of the CSS 2 spec is the one true interpretation. Unfortunately.

login or register to post comments

Interpreting CSS2

Submitted by bmason on July 3, 2002 - 10:16.

Well, I know vaguely that there was a huge debate about whether this interpretation was correct. FWIW, Eric Meyer makes this observation in the description of the bug:

To be fair, the CSS Working Group has confirmed that the CSS2 specification does call for the behavior Gecko has implemented, and the Mozilla team is to be commended for doing such a thorough job of implementing the CSS2 standard.

I agree that it's a shame that it was only after 1.0 was released that this was addressed. I would almost have preferred the status quo. Now we'll have Netscape 6 doing one thing and (presumably) Netscape 7 doing something else.

login or register to post comments

what's left?

Submitted by jswiders on July 3, 2002 - 13:54.

what doctypes does that leave to get full standards mode? and will it handle the <?xml declaration any better than IE 6 does (where it causes the doctype to be ignored, and goes into 'quirks' mode)?

and wasn't NS 7 already branched? i.e., is it maybe too late for this to be included?

login or register to post comments

Re: what's left?

Submitted by bmason on July 3, 2002 - 16:01.

Standards mode, from what I can piece together, will be triggered by:

  • XHTML 1.1
  • XHTML 1.0 Strict
  • HTML 4.0/4.01 with no URL
  • A few other less common ones listed on Mozilla's DOCTYPE document
  • Any system DOCTYPE besides the one exception made for IBM
  • Any page served as text/xml or other xhtml/xml MIME types, regardless of the DOCTYPE
  • Pretty much any other unknown DOCTYPE not already covered in Mozilla's documentation.

As far as I know (and have seen in practice), Mozilla does not have issues with the xml declaration like IE6 does.

Netscape 7 Preview Release 1 was based on Mozilla 1.0 Release Candidate 2 (now there's a jumble). I'm not sure what the final N7 will be based on, but my impression from trying to decipher the keywords on the Bugzilla bugs involved is that there was a push to get this done so that it would be in N7 final.

login or register to post comments

Whiners?

Submitted by Zaccix on July 8, 2002 - 18:54.

Is it just me, or has the Moz Group yielded to those people who have problems with the CSS2 line-height rules and don't want to sacrifice their oh-so-lovely designs in order to actually write some valid code? If, as bmason pointed out, Mozilla 1.0 actually implements line-height correctly, then why should validity be sacrificed in the name of design?

*Shakes head*

login or register to post comments

Re: Whiners

Submitted by bmason on July 8, 2002 - 19:22.

Well, the line-height rules are already set aside when the browser is in its full quirks mode. So it's not as if something has been implemented that never existed before.

I believe (and I should add that I speak for no one at Mozilla) that the point is that currently, in-transition modes of coding such as XHTML 1.0 Transitional (where the point of this DOCTYPE is that the code is known to include presentational things that should be phased out in the future) are rendered in full standards mode. So sites that cannot yet depend on CSS for full layout and are using tables for it are falling apart because Mozilla is treating a in-transition mode of coding with full standards rules that no browser has ever enforced before.

By creating the new almost standards mode, authors can write code that is as close to standard as possible without being treated as absolutely standard and having their page fall apart. The code can be as strict as it gets, except it needs a table to do page layout.

For more along this line, see Eric Meyer's comments in the original Bugzilla bug.

login or register to post comments

Re: Whiners

Submitted by jaylard on July 9, 2002 - 09:38.

I guess that I must be one of those whiners. And I strongly favor W3C standards compliance. But the problem is that the CSS 2 box model is very complex, and at times appears self-contradictory. The Mozilla interpretation of how line-height should be applied to replaced inline content, such as images, is one interpretation of the spec. Others, such as Tantek Çelik, offer a different, well-reasoned interpretation of the W3C box model that is also faithful to traditional rendering.

Is the CSS 2 spec an oracle from the gods, infused with divine wisdom beyond our ability to attain? Or is it a technical recommendation that is subject to interpretation, or even revision if need be? Can intelligent people draw different conclusions on how to implement complex technical theories? I think so.

login or register to post comments

Update

Submitted by bmason on August 29, 2002 - 10:34.

Well, Mozilla 1.1 and Netscape 7.0 Final (which is based on the Mozilla 1.0.1 branch) are out now, both supporting this new mode. However, if you look at Page Info on a given page, it will still report the page as Standards Compliance Mode even if it's really in Almost Standards mode. This is reported in Mozilla bug 154359.

login or register to post comments

IBM update

Submitted by bmason on November 4, 2003 - 23:13.

IBM apparently decided now that they would be better served by having their DOCTYPE render in quirks mode after all.

login or register to post comments

The access keys for this page are: ALT (Control on a Mac) plus:

evolt.orgEvolt.org is an all-volunteer resource for web developers made up of a discussion list, a browser archive, and member-submitted articles. This article is the property of its author, please do not redistribute or use elsewhere without checking with the author.