Bug 14428 - Investigate if onfoo properties should be handled in a special way in interface.prototype
Summary: Investigate if onfoo properties should be handled in a special way in interfa...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 11:57 UTC by Olli Pettay
Modified: 2011-12-20 06:49 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olli Pettay 2011-10-11 11:57:35 UTC
In bugs https://bugzilla.mozilla.org/show_bug.cgi?id=691059 and
https://bugzilla.mozilla.org/show_bug.cgi?id=684671
we had to change prototype handling so that
Document.prototype.onreadystatechange and
HTMLElement.prototype.onmouseenter/leave don't throw when setting.

Hopefully those are just special cases which we can remove at some point.
But if we're not lucky, we may need to special case all the onfoo properties.

IE9 seems to behave like Gecko used to, which is why
https://bugzilla.mozilla.org/show_bug.cgi?id=691059 happens also in IE9 when
the test page is forced to load in IE9 mode.
Comment 1 Boris Zbarsky 2011-10-11 16:46:02 UTC
Note that Gecko's behavior here has nothing to do with the prototype.  We simply treat a set as a no-op and return null on get if the |this| of the getter/setter is not an instance of the right interface.  That includes invoking the getter or setter on the prototype, but also on any other random object.
Comment 2 Olli Pettay 2011-10-11 16:49:35 UTC
True. The bugs just happened to be about setting
interface.prototype.onfoo
Comment 3 Cameron McCormack 2011-10-12 03:08:33 UTC
Do we need to introduce a [DoNothingIfBadThisValue] extended attribute?
Comment 4 Travis Leithead [MSFT] 2011-11-10 20:26:41 UTC
I'd really prefer to avoid another hack if possible. Sites that are updating do get the latest versions of Prototype (which has this problem and has long since been fixed). We could cater to sites using older libraries that do bad things, or we can let these sites naturally evolve as more browsers implement the spec. 

store.sony.ca is specifically sending IE the meta tag telling it to use it's old compatibility binding for the DOM (IE8 mode):
<meta http-equiv="x-ua-compatible" content="IE=8" />

This lets them update on their timetable. I plan to contact them as well to request that they update to newer versions of prototype.
Comment 5 Cameron McCormack 2011-12-13 01:27:29 UTC
Sorry, forgot to mention that I added [LenientThis] a month or so back:

  https://www.w3.org/Bugs/Public/show_bug.cgi?id=14037#c46

and Ian added it to the onreadystatechange attribute.  This seemed the best way forward given that the broken library being used, Sarissa, is apparently unmaintained.

Olli, since you originally filed this bug, could you please indicate for the Disposition of Comments document whether this resolution was satisfactory.  Thanks.
Comment 6 Boris Zbarsky 2011-12-16 16:29:28 UTC
We need that also on at least mouseenter/mouseleave (Gecko did that on elements, documents, windows, but it may only be needed on elements).
Comment 7 Cameron McCormack 2011-12-20 06:49:03 UTC
(In reply to comment #6)
> We need that also on at least mouseenter/mouseleave (Gecko did that on
> elements, documents, windows, but it may only be needed on elements).

I don't know that there's any spec that defines onmouseenter and onmouseleave attributes at the moment.