franky1978 / igoogle-legacy

Automatically exported from code.google.com/p/igoogle-legacy
1 stars 0 forks source link

gadgets.window.adjustHeight() not called when scroll bar appears on IGoogle page #609

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Description of the bug/feature.
==================================
After gadgets are placed on the iGoogle page, additional content is added
to that page which increases the page height.  This causes a vertical
scroll bar to appear in the browser window, late in the rendering process.
 The appearance of the scroll bar reduces the width of the page and thus
reduces the width of each gadget.  The reduced gadget width can cause
reflowing of text within the gadget, increasing the height of content
within the gadget.  This, in turn, can cause text to overflow the height of
the gadget as set by gadgets.window.adjustHeight().

This is a timing-related problem.  Even though the gadget uses
gadgets.window.adjustHeight() when it is opened, the reduction in gadget
width and consequent increase in the height of its contents is occurring
after the gadget has run.  There's no way for the gadget to know that the
inner width of the window has been reduced.

This seems to be a symptom of a larger problem: I've found no defined
interface to force the effect of onresize="gadgets.window.adjustHeight()".
 The symptom described here, however, will occur even if the user does not
resize the window.

PLEASE FILL OUT THE FOLLOWING FOR A BUG REPORT ONLY:

What steps will reproduce the problem?
======================================
1. Create a gadget which displays multiple lines of text (and nothing
else), with no bottom-margin, then calls gadgets.window.adjustHeight() to
adjust its height to that of the contained text.
2. With the gadget displayed and a vertical scroll bar visible (normal on a
1024 X 768 display), gradually reduce the width of the window, watching as
the text reflows.  Stop as soon as the text flows to a new line (increasing
the text-area height).
3. Refresh the page. Observe that initially there is no vertical scroll
bar.  Observe that the gadget text is initially rendered without the last
line that was created above.  Observe that after the gadget is rendered,
additional data is added outside the gadget and that this data results in a
vertical scroll bar in the window.  Observe that the text in the gadget
reflows and is clipped at the bottom of the gadget.

What is the expected output?
============================
A gadget height that corresponds to the height of its content AFTER all
other elements on the page have been rendered. 
What is the actual output?
==========================
Gadget height is not adjusted to the height of its content after a vertical
scroll bar has appeared in the containing window.

Which browsers have you experienced this on?
============================================
Several.  IE6 does not fail because it reserves space for the vertical
scroll bar prior to rendering the page.
Which operating systems have you experienced this on?
=====================================================
W98SE.  Not tested elsewhere, but probably not relevant.

Please provide any additional information below.
The Gadget Checker seems to have found a way to implement
onresize="gadgets.window.adjustHeight()".  That might be a useful model to
look at and would resolve the larger problem of window resize effects.

Original issue reported on code.google.com by Chris.Beall2@gmail.com on 12 Sep 2009 at 4:23

GoogleCodeExporter commented 8 years ago
This seems like an acceptable edge-case with a reasonable workaround (the 
onresize
trick you've mentioned).

Original comment by api.dwh%...@gtempaccount.com on 7 Jan 2010 at 10:14