GWT 1.1 bug?

4 views
Skip to first unread message

Richard Garand

unread,
Aug 15, 2006, 2:22:57 PM8/15/06
to Google Web Toolkit
I'm using a layout similar to the mail example, but I can't get the
right size for the scrolling area. The window resize event handler gets
a size of 763x50 in the hosted browser; adding the same code to the
mail sample shows 788x440. I've tried using the default parameters to
the window resize handler and calling getClientHeight(), but it's
always the same. How can this be returning the wrong value?

Richard Garand

unread,
Aug 15, 2006, 3:06:22 PM8/15/06
to Google Web Toolkit
This stopped after I removed the doctype from the HTML file. Still
doesn't make sense, but it works.

Mat Gessel

unread,
Aug 15, 2006, 11:10:47 PM8/15/06
to Google-We...@googlegroups.com
By removing the DTD, you have likely changed the rendering mode to quirks mode:
http://www.quirksmode.org/css/quirksmode.html

I did some tests a while back to determine how to get valid values for
the browser viewport (i.e client area):
http://www.asquare.net/javascript/

Window.getClientHeight() is implemented as:
if ($wnd.innerHeight)
return $wnd.innerHeight;
return $doc.body.clientHeight;

As you can see in the result matrix, getClientHeight() returns the
height of the body element in IE6 and Firefox when in strict rendering
mode:
http://www.asquare.net/javascript/tests/ViewportTestResults.html

Search the group for "strict mode" or "standards mode" and you will
find many more issues. I'd recommend sticking with quirks mode for the
time being.

--
Mat Gessel
http://www.asquare.net

Reply all
Reply to author
Forward
0 new messages