Let us consider the setting next HTML for DynLayer
which have not fixed size (we expect that layer should
be auto-resized to the content size):
var dlr = new DynLayer();
dlr.setHTML("Test<img
src='http://www.google.com/images/logo.gif'>");
dynapi.document.addChild(dlr);
If the image in HTML (<img
src='http://www.google.com/images/logo.gif'>) isnt
cached by the browser early then we have problem with
auto-resizing of the layer.
The core place in code (I consider the case of DOM
browser only) is: dynlayer_dom.js, line 47, in function
DynLayer._assignElement, where we call
dlyr.setSize(cw,ch). At the moment of calling
_assignElement we have incorrect values for
getContentWidth and getContentHeight yet and so we set
the wrong size to the layer
I think we should resize layer when the DynLayer
completes the job by loading all resources (images and
etc.) Unfortunately I dont know how to detect the
finish of all jobs during the changing innerHTML of
element (our case)
I attached the test file which doesnt work on IE and
Mozilla
test
Logged In: YES
user_id=184788
Checking for completiong can be done in IE using the
onreadystatechange event and then checking if readyState == 4
I _think_ readystate 4 = finished rendering, but you will
want to test to be sure.
This event is not very well documented at all and was only
found after about 4 months of trying to solve an "images
abort loading" issue we where having oh-so long ago.
Also note: I have absolutly no idea how to do this in
Mozilla but give me time :-P