W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2014

Re: Form submission participation (was Re: Goals for Shadow DOM review)

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 21 Feb 2014 22:28:36 +0000 (UTC)
To: Maciej Stachowiak <mjs@apple.com>
cc: Jonas Sicking <jonas@sicking.cc>, Edward O'Connor <eoconnor@apple.com>, Webapps WG <public-webapps@w3.org>
Message-ID: <alpine.DEB.2.00.1402212226000.31525@ps20323.dreamhostps.com>
On Fri, 21 Feb 2014, Maciej Stachowiak wrote:
> I'd guess most sophisticated webapps do not use attribute-based event 
> handlers (as opposed to addEventListener), so they would not get this 
> convenient scoping benefit.

That's not clear to me. I mean, certainly today, with div soup, they 
don't. But that's at least partly because there's no sane way to do it 
when your markup isn't really declarative in any useful sense.

When you have Web components that let you get the effect you want while 
sticking to a terse markup language, it becomes much more feasible to 
return to using inline event handlers.

> If you're looking at an out-of-line function, then your comparison is:
> this.a.value = process(value)
> this.querySelector("#a").value = process(value)
> which is a less dramatic difference.

It's a pretty compelling difference, IMHO.

> Also, the short version gives you the risk of namespace conflicts with 
> the built-in methods and properties of form.

You can do this instead if that feels like a real risk:

  this.elements.a.value = process(value)

...but in practice I think it's a pretty minimal risk.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 21 February 2014 22:28:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:22 UTC