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

Boris Zbarsky bzbarsky at MIT.EDU
Mon Dec 3 17:11:37 PST 2012


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

Indeed.  I would have no problem with just having 
HTMLElement.prototype.onerror's setter set an error handler on the body 
itself, like it would on any other HTML element, and likewise for the 
getter.

> 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 method/getter/setter with the same
> name, then it should throw.

Hmm.  That, as phrased, is pretty complicated to implement in a 
performant way, if the two methods/getters/setters have the same 
signatures...

-Boris



More information about the whatwg mailing list