Re: <script> as handler for XML events

smaug <[email protected]> Sun, 02 Jul 2006 21:43:46 +0300
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
Chris Cross wrote:
> smaug wrote:
>> So what is |this| in the <script> ? Is it |window|, 
>> |HTMLScriptElement| or the currentTarget of the |event| or what?
>>
> 
> A <script> with this line of code in Opera 8.5 returned true
> 
>     alert(this == window.top);
> 
> so it looks like |this| is the main browser window in Opera.
> 
> A similar test in NetFront reveals that |this| is the target of the 
> event. Nothing like choice in the market, eh? ;-)
> 
> What do you think |this| *should* be?

I *think* it should be |window|. That way it would be the same for 
normal <script> elements and XML Events handlers. Though, normal
even handlers have .currentTarget as |this|...

> 
> chris