From: Joachim L. <lu...@ho...> - 2001-01-30 14:19:02
|
Time for me to bud in... I did quite a lot of testing for this bug some time ago. Mozilla.org had issued the bug at that time as #56810 : http://bugzilla.mozilla.org/show_bug.cgi?id=56810 I never got the work-around to, well, work :-( But I got the right result by calling the function as the result of a timeout: setTimeout("alert("+o+".elm.offsetWidth)", 0); In other words: timeout in 0 ms - just after the layout engine has done its deed Now I checked bugzilla again, and there is another one: http://bugzilla.mozilla.org/show_bug.cgi?id=65548 Guess it never got fixed... The problem as I see it is this: Because the bug is in Netscape 6 (I assume, the installer crashes for me, but I use Mozilla 0.6 which is supposed to be from the same codebase) the fix must work for the release version. I was hoping there was a way to programmatically get the result, such as this.elm.ownerDocument.defaultView.getComputedStyle(this.elm,null).getPropertyValue("width"); but whatever I tried I couldn't get it to work. The only reliable way was the setTimeout() trick. I think the easiest for you to make it work in DynAPI is to skip the precreation code for that browser, at least when the width and height aren't known. (The code here is from memory - it seems to be right though.) /Lunna At 2001-01-30 11:24, you wrote: >Hi, > >I remember a post from Robert saying he'd got offsetWidth and offsetHeight >working in NS6 using a setTimeout. Was this specific to one of the widgets >Robert, or did it fix W/H for everything in NS6? > >If you need a setTimeout for the thing to work properly, it sounds like a >bug in the browser. The great thing about Mozilla is if you post a bug, >they'll fix it for you ;-) It can take a while, it depends on how important >the developers feel that peice of functionality is. But I think it would be >worth writing a test case and a bug report for the W/H bug. I can submit one >if someone (Robert I guess) tells me how to reproduce the bug, that is how >it works versus how you think it should work. > >Something else which might be if interest to DOM enthusiasts, I was >wondering why offsetHeight and offsetWidth and similar measurements aren't >in any of the DOM's. I posted a query about this to ww...@w3..., and the >response was it's been put on the back burner as there hasn't been that much >interest in this functionality. Apparently it will probably end up in DOM3. >I thought it would have been pretty core functionality... |