From: Cameron H. <ca...@bi...> - 2001-01-30 10:27:57
|
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... |
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... |
From: Michael Br. <mb...@st...> - 2001-01-30 23:35:58
|
> From: Joachim Lundgren <lu...@ho...> > Reply-To: dyn...@li... > Date: Tue, 30 Jan 2001 15:15:59 +0100 > To: dyn...@li... > Subject: Re: [Dynapi-Dev] ns6 w/h and browser advocacy [...] > But I got the right result by calling the function as the result of a timeout: > setTimeout("alert("+o+".elm.offsetWidth)", 0); this is also true for IE5 on the Mac, but you have to wait a little longer. I did some tests some time ago and there wasn't a safe time, in which the values would get updated. So I implemented a function (no DynAPI) that stores the old values and then checks every few ms if the values have been updated and if so, it calls whatever you like. This was the only solution I could come up with, I haven't ever found a clue on how it could be done differently. ... the drawback is of course that you can't use return values to directly do more stuff with it, there has to be another function that does the things you want to do after you know the size of the content. if this mechanism would be implemented into the DynAPI, it would change the way one has to deal with getContentWidth/getContentHeight (maybe using a "onThe_moment_our_contentsize_values_are_finally_correct"-event or something like that) i really need this feature in IE5/Mac too, so if nobody comes up with a better solution, I will definitely implement it that way. -- Michael Buerge BTW: i have the impression that there arent any Mac-developers here. the examples in this and last weeks snapshots mostly didn't work on the Mac and there wasn't one post regarding that... ...and what about the bug i posted (elm problem)? can somebody reproduce it? can somebody help me figuring it out? |
From: Matthew A. S. <ms...@go...> - 2001-01-31 04:02:26
|
I have to support the macintosh as well, though because I get very little responses on this list I usually have to limit myself to the things that I can get to work. Not being able to get the content size has been a very irritating problem for me. Usually I end having to set sizes manually which can cause things to look a little wierd on some of the browsers. M. -----Original Message----- From: dyn...@li... [mailto:dyn...@li...]On Behalf Of Michael Burge Sent: Tuesday, January 30, 2001 3:38 PM To: dyn...@li... Subject: Re: [Dynapi-Dev] ns6 w/h and browser advocacy > From: Joachim Lundgren <lu...@ho...> > Reply-To: dyn...@li... > Date: Tue, 30 Jan 2001 15:15:59 +0100 > To: dyn...@li... > Subject: Re: [Dynapi-Dev] ns6 w/h and browser advocacy [...] > But I got the right result by calling the function as the result of a timeout: > setTimeout("alert("+o+".elm.offsetWidth)", 0); this is also true for IE5 on the Mac, but you have to wait a little longer. I did some tests some time ago and there wasn't a safe time, in which the values would get updated. So I implemented a function (no DynAPI) that stores the old values and then checks every few ms if the values have been updated and if so, it calls whatever you like. This was the only solution I could come up with, I haven't ever found a clue on how it could be done differently. ... the drawback is of course that you can't use return values to directly do more stuff with it, there has to be another function that does the things you want to do after you know the size of the content. if this mechanism would be implemented into the DynAPI, it would change the way one has to deal with getContentWidth/getContentHeight (maybe using a "onThe_moment_our_contentsize_values_are_finally_correct"-event or something like that) i really need this feature in IE5/Mac too, so if nobody comes up with a better solution, I will definitely implement it that way. -- Michael Buerge BTW: i have the impression that there arent any Mac-developers here. the examples in this and last weeks snapshots mostly didn't work on the Mac and there wasn't one post regarding that... ...and what about the bug i posted (elm problem)? can somebody reproduce it? can somebody help me figuring it out? _______________________________________________ Dynapi-Dev mailing list Dyn...@li... http://lists.sourceforge.net/lists/listinfo/dynapi-dev |
From: Dann <da...@to...> - 2001-01-30 15:45:59
Attachments:
dann.vcf
|
Hi, Has anybody ever done some testing or wondered about the safety nature of concurrent execution of code in JS ? It struck me that this timeout gimmick has been discovered over and over again, to apparantly fix a recurring issue. It was already pointed out by Cameron, that if you could fix this kind of behaviour by using a Timeout, you probably stumbled on a browser bug... usually, in my years of fooling around with JS, a Timeout could even prevent a browser from crashing entirely. What exactly happens if you would hook load event handlers to to two images, who would fire simultaneously and call the same function, to change some common global variables ? CU, Dann |