|
From: Dan W. <dy...@da...> - 2003-07-24 02:11:00
|
I really should use the email address im signed up for on the list
-----Forwarded Message-----
To: dyn...@li...
Subject: Re: [Dynapi-Dev] Permission denied in Mozilla 1.4
Date: 23 Jul 2003 21:10:08 -0500
Well, using the attached html file, i found out a little bit more about
this issue, but it appears to get more and more confusing. The file
attached basically dumps the entire dom name/value pairs of
r/r.parentNode/... onto the screen to be examined.
(this has been edited a few times, so it might not flow very well)
i finally got it working using the same code as raymond first used, and
using the below change when i made sure that the scan function was only
called once. I think we probably have a race condition happening
somewhere here. (for those not familiar with threading, more than one
thread/process/piece of code, etc manipulating a single variable at the
same time) To get the error to go away, i just declared a new global
variable named numb to 0, then in the onmouseout(i removed the
onmouseover for testing) i checked to see if it was still zero, if it
was, i assigned 1 to it, and called the function.
When i changed the javascript code to read:
var r = elm;
instead of:
var r = e.relatedTarget;
it appears to work correctly, but mozilla also adds some intermediate
wrappers for the html elements, for example there is a node named INPUT,
and then a node named HTMLInputElement
part of the problems i was having debugging this is that the scan
function is called multiple times
OK, some of the above might be incorrect now that i have played with
this further, but the bad results started coming back up(it displays the
HTML node first) when i added the onmouseover handler back in. This
tells me that we have more of a race condition than i first thought, and
it might actually be a bug on the mozilla side. I think that the scan
function is being called multiple times, even though i tried to prevent
that. probably has something to do with the global variable 'event'
being changed as we are operating on it in the scan function.
Before i screw this up further im sending this to the list.
Hope someone can benefit from this,
Dan Willemsen
On Mon, 2003-07-21 at 08:57, Raymond Irving wrote:
> Hello,
>
> Here's how we can simulate the error in Mozilla 1.4:
>
> Error: uncaught exception: Permission denied to get
> property HTMLDivElement.parentNode
>
> Is this an error in moz 1.4 or an I doing something
> wrong in the following code?
>
> <script>
> function scan(e,elm) {
> var r = e.relatedTarget;
> while(r && r.parentNode){
> r = r.parentNode
> //alert(r)
> }
> }
> </script>
> <div id="dv"
> style="position:absolute;left:100;top:100">
> <form name="frm">
> <input type="textbox" name="tbox" value="test..."
> onmouseover="scan(event,this)"
> onmouseout="scan(event,this)">
> </form>
> </div>
>
>
> --
> Raymond Irving
>
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> _______________________________________________
> Dynapi-Dev mailing list
> Dyn...@li...
> http://www.mail-archive.com/dyn...@li.../
--
Dan Willemsen <dy...@da...>
|