What
The Domino HTTP task automatically writes the doctype, as the first line in the html code. IBM has released Domino 6.5.3 with an interesting fix for web developers. It is now possible to add a system url to the doctype of the html generated by Domino.Why
When a system url is added to the doctype, the newer browsers switches into standard compliance mode. This feature makes a big difference in how newer browsers renders web pages. Newer browsers are MSIE 6+ and Gecko based browsers, like Mozilla Seamonkey and Mozilla Firefox. It may also include Safari that uses the KHTML engine.Older browsers calculates width and height of CSS styled elements by subtracting border and padding from content width. The CSS 2 standard specifies that the content width of an element does not include padding and border. Read the specific details about the box model and the Visual formatting model.
Another issue is the calculation of relative sizes, like width:100%. In the CSS2 standard it is relative to the parent element, but in old browsers it is calculated relative to the view port (window).
How
Upgrade Domino to at least version 6.5.3 and set the DominoCompleteDoctype environment variable in notes.ini. It has 3 different values:0 = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
A value of zero is the default/old behavior, with all the problems that creates. At first I thought 2 (strict) was the way to go, but Domino still generates old-school html, that does not validate as html 4.01 strict. So I ended up using 1 (transitional).
Gotcha's
When the browser is in standard compliance mode, the css selectors become case-sensitive.Example html:
<div id="container">
...
</div>
This css selector does not work:
#Container {...}This css selector works:
#container {...}In Gecko based browsers, the Content-Type of the CSS become important. The CSS will be ignored if the Content-Type is not text/css. I use a page (Notes design element) for CSS style sheets.
The bad news is that DominoCompleteDoctype is a server wide setting, that will affect all the websites hosted on that Domino partition. So you will either need to test and adjust all your sites at ones, or divide your server into two partitions.
Update - the good news
As of Domino 7.0.2 there is a new field that allows you to set the doctype on a form basis. Just add a computed for display field called $$HTMLFrontMatter, with this formula:"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" + @NewLine
Last updated: 11/05/2008