[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Public WebGL] Doctype issues
I've started a separate thread on this following on from the backbuffer resizing issues. Using the
correct and consistent doctype is important. Mark Callow has pointed out some layout and spacing
issues resulting from trying to make the canvas fit when using <!doctype html>. Greg Tavares
proposed using the 4.01 Transitional doctype to fix these issues.
Indeed, they do make the webgl canvas fit better. However, according to the HTML5 spec <!doctype
html> is the correct doctype to use going forward. I randomly sampled the webgl demos and found that
all that I looked at used this doctype.
<!doctype html> is supposed to be 'standards mode' compliant, and lots of CSS now depends upon using
this doctype to get consistent layout results. For example, all the newer GWT widgets only work in
standard mode. GWT is not the only web framework, but most of the modern web frameworks now require
standards mode compliance for correct rendering.
So please would someone confirm that <!doctype html> is the recommended doctype for WebGL.
If so, then could someone explain how we get around the issues as pointed out by Mark's previous
email/example? Using 4.01 Transitional may work when all that is required is to size the canvas to
fit, but there will be many cases of the use of webgl where there needs to also be support for the
html5 doctype. For example, in one of my applications there is a 'full window' mode which you can
switch in and out of in an AJAX app using a keyboard shortcut. Consequently the doctype needs to be
the same as for the non-full screen mode and 4.01 Transitional simply doesn't work in that case.
I've tried a few experiments with box-sizing: border-box but they don't seem to make any difference
(I assume Chrome 9 supports box-sizing, and yes I tried -moz-box-sizing: on FF)
I think the problem here is going to be that the webgl canvas will be used in two different types of
web application. Many of them will be games, or game-like, where the webgl canvas occupies the full
browser window. In this case its probably OK to use the 4.01 Transitional.
However, many applications will need to work within a 'strict' standards compliance mode. Designers
are not going to be happy when they can't get the canvas to fit into a pre-determined space.
You are currently subscribed to email@example.com.
To unsubscribe, send an email to firstname.lastname@example.org with
the following command in the body of your email: