Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2013-01-07 Thread Ian Hickson
On Mon, 3 Dec 2012, Boris Zbarsky wrote: On 12/3/12 7:33 PM, Ian Hickson wrote: Note that onerror has a different type on HTMLElement and HTMLBodyElement. Yes, indeed. That's the biggest problem with forwarding to Window for the HTMLElement.prototype case for onerror here: the types

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2013-01-07 Thread Cameron McCormack
On 8/01/13 7:31 AM, Ian Hickson wrote: heycam, did we resolve this at the WebIDL level by any chance? Or is this still open? (If the latter, is there a bug# for it? Or is this an HTML problem I need to fix myself?) No, this didn't get resolved.

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-04 Thread Peter Van der Beken
On 04/12/12 01:33, Ian Hickson wrote: onscroll is a case where there's really no reason to use a different setter, agreed. So I've commented that out (and it's similar friends). That still leaves onerror though. The same change should probably be done to HTMLFrameSetElement. Peter

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-04 Thread Ian Hickson
On Tue, 4 Dec 2012, Peter Van der Beken wrote: On 04/12/12 01:33, Ian Hickson wrote: onscroll is a case where there's really no reason to use a different setter, agreed. So I've commented that out (and it's similar friends). That still leaves onerror though. The same change should

[whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Boris Zbarsky
Consider this testcase: var desc = Object.getOwnPropertyDescriptor(HTMLElement.prototype, onscroll); desc.set.call(document.body, function() { alert(this); }); Is the listener added on the body, or the window? The relevant parts of the spec are:

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Ian Hickson
On Mon, 3 Dec 2012, Boris Zbarsky wrote: Consider this testcase: var desc = Object.getOwnPropertyDescriptor(HTMLElement.prototype, onscroll); desc.set.call(document.body, function() { alert(this); }); Is the listener added on the body, or

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Boris Zbarsky
On 12/3/12 2:05 PM, Ian Hickson wrote: What do browsers do? WebKit and Opera don't put the property on the prototype at all, so the whole issue is not even testable there. This obviously doesn't follow WebIDL, but that's not relevant here. It looks like Gecko currently doesn't allow the

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Cameron McCormack
On 4/12/12 6:31 AM, Boris Zbarsky wrote: It's a similar situation, yes. But in this case I don't see why you'd need an IDL annotation of any sort at all. If you want the behavior to be the same, just don't define onscroll on Bar at all and define the one on Foo to special case the two Foo

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Ian Hickson
On Mon, 3 Dec 2012, Boris Zbarsky wrote: You have IDL like this: interface Foo { attribute EventHandler onscroll; }; interface Bar : Foo { attribute EventHandler onscroll; }; WebIDL already defines how this behaves: there are getters/setters on both Foo.prototype

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Cameron McCormack
On 4/12/12 11:33 AM, Ian Hickson wrote: Per our IRC discussion just now, I think I would propose that when a method/setter/getter from a prototype of interface A is called against an object that is of an interface B (or one of B's descendants), where B is a subclass of A, and B defines its own

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Boris Zbarsky
On 12/3/12 7:33 PM, Ian Hickson wrote: Note that onerror has a different type on HTMLElement and HTMLBodyElement. Yes, indeed. That's the biggest problem with forwarding to Window for the HTMLElement.prototype case for onerror here: the types are different. onscroll is a case where

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Cameron McCormack
On 4/12/12 12:11 PM, Boris Zbarsky wrote: Hmm. That, as phrased, is pretty complicated to implement in a performant way, if the two methods/getters/setters have the same signatures... Since I'm not terribly familiar with our generated bindings code, I'm not really sure what that would be.

Re: [whatwg] Specification unclear about how HTMLElement.prototype.onscroll's getter/setter should behave for body elements

2012-12-03 Thread Boris Zbarsky
On 12/3/12 8:16 PM, Cameron McCormack wrote: On 4/12/12 12:11 PM, Boris Zbarsky wrote: Hmm. That, as phrased, is pretty complicated to implement in a performant way, if the two methods/getters/setters have the same signatures... Since I'm not terribly familiar with our generated bindings