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
> HTML.

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.

Cheers
/Erik

-- 
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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:40 GMT