Re: window.event and Event.srcElement

On 3/25/13 4:36 PM, David Bruant wrote:
>> We could complicate the scoping setup for event handlers even more, of
>> course.  Would any UAs actually be willing to implement that (given
>> that e.g. Chrome doesn't even implement the current, simpler, scoping
>> setup sanely)?
> Any info on why they don't implement the spec scoping rules?

Because it happened to be easy in their implementation to do something 
with with() instead, last I checked.

On the other hand, I just double-checked the bug report and they claim 
to have fixed it (see 
http://code.google.com/p/chromium/issues/detail?id=80911 and I wish I'd 
get mail to some sane mail address from that bug reporting system).  So 
maybe they'd be willing to do something more complicated....

> Is it going to be a case of de-facto standard too?

I doubt it.

> Only an insane option. Sharing as food for thoughts:
> when about to call a function from an eval'ed on* attribute string,
> change the function's [[Scope]] to contain an extra scope with an
> "event" variable. Restore the [[Scope]] to its original value when the
> frame is dropped.

I think that qualifies as insane, yes.  ;)

-Boris

Received on Tuesday, 26 March 2013 02:18:09 UTC