W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2013

Re: [whatwg] Should onfoo event handler properties be on Element or HTMLElement?

From: Erik Dahlstrom <ed@opera.com>
Date: Tue, 08 Oct 2013 16:26:59 +0200
To: whatwg@lists.whatwg.org
Message-ID: <op.w4m3q9yfgeuyw5@gnorps>
On Tue, 08 Oct 2013 15:49:48 +0200, Philip J├Ągenstedt <philipj@opera.com>  
wrote:

> The spec says HTMLElement, by way of GlobalEventHandlers and
> "HTMLElement implements GlobalEventHandlers":
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#globaleventhandlers
> http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlelement
>
> Gecko has "HTMLElement implements GlobalEventHandlers" in its IDL,[1]
> but somewhat surprisingly also "SVGElement implements
> GlobalEventHandlers".[2]
>
> I'm trying to add GlobalEventHandlers IDL in Blink [3] to reduce code
> duplication, where the current state of things is that the onfoo event
> handler attributes are on Element, not HTMLElement. I can see two
> options:
>
> 1. Do what Gecko does, even though there's no SVG spec requiring it yet.
> 2. Just say "Element implements GlobalEventHandlers".
>
> I would prefer option 2, since we already have a unified "Document
> implements GlobalEventHandlers".

Either option is probably fine from a web compat standpoint, but I'd  
prefer option 2 too.

> Would other browser vendors be OK with this change?

SVG WG resolution relating to this topic (minutes from Seattle 2011 F2F):

   http://www.w3.org/2011/07/27-svg-minutes.html#item03

With regards to browser vendors present in that meeting, we had people  
 from Microsoft, Google, Mozilla and Opera.

SVG2 lists this as an issue where SVG wants to align with HTML, see  
editor's draft: https://svgwg.org/svg2-draft/interact.html#SVGEvents.


-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Tuesday, 8 October 2013 14:27:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:11 UTC