views:

573

answers:

2

I think I should use <!DOCTYPE html> for my new GWT application; I understand that doing so will put my application into standards-compliant mode. Am I correct? Are there any disadvantages to using this doctype? Does GWT work properly in standards-compliant mode? I'm wary because the GWT tutorial still uses the HTML 4.01 transitional doctype.

+1  A: 

Using <!DOCTYPE html> will put the web browser into standards mode (as opposed to quirksmode) which is almost certainly what you want. But the HTML 4.01 Transitional doctype will also trigger standards mode, so there's no difference there.

I've no idea of the implications of using one or the other with GWT - but I doubt there are any advantages to using the HTML5 doctype to be honest, unless GWT is doing special things to support HTML5.

Andy Hume
One difference that I noticed is this: with the HTML 4.01 Transitional doctype, text input fields use the border-box sizing model; whereas with the HTML5 doctype, they use the content-box sizing model.
David
The GWT-generated comment at the top of my project's HTML file says 'The HTML 4.01 Transitional DOCTYPE declaration above set at the top of the file will set the browser's rendering engine into "Quirks Mode".'
Glenn
+2  A: 

The new layout panel functionality in GWT 2.0 requires standards mode and does not work in quirks mode.

Chi
Igor Klimer