W3C home > Mailing lists > Public > www-svg@w3.org > October 2008

Re: [1.2T-LC] evt and event (ISSUE-2055)

From: Erik Dahlström <ed@opera.com>
Date: Wed, 08 Oct 2008 13:34:26 +0200
To: "Cameron McCormack" <cam@mcc.id.au>, www-svg@w3.org
Message-ID: <op.uipefo0ddhsuf5@gnorps.linkoping.osa>

On Thu, 02 Oct 2008 08:07:57 +0200, Cameron McCormack <cam@mcc.id.au> wrote:


>   <!DOCTYPE html>
>   <body onload='alert(event)'>
>   <script>
>     var event = 123;
>   </script>
> My feeling (and Erik can correct me if I’m wrong) is that there’s not
> likely to be a web compatibility problem with going against what Opera’s
> doing and making both ‘evt’ and ‘event’ definitely resolve to the event
> object rather than properties on the window object, consistent with

What we do is equivalent to 'var evt=event;' inside the textcontent of the handler element.

Furthermore, we treat the handler element as a special kind of script element that doesn't execute unless triggered by an event, and the corresponding Event object is inserted into the handler's scripting context when it's executed. It's not treated as a function, or as in the event handler attributes at all. It is in a separate scope in the sense that if you define variables they are only visible inside the handler, not outside (in other script or handler elements). No special 'this' keyword or scope-chain is introduced in our current implementation.

It can also be noted that most of what the scope-chain wording does is add syntatic sugar. I think that most if not all data can be fetched by the script itself by looking at the Event object.


Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Wednesday, 8 October 2008 11:37:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:20 UTC