Re: [html5] Event handler DOM attributes

On Fri, 28 Aug 2009, Jens Meiert wrote:
> >
> > The presentational markup wasn't included in HTML5 because it is 
> > unnecessarily media-dependent. Event handlers don't seem to have this 
> > problem. I don't think it makes sense to force authors to separate 
> > their usir interface logic from their user interface semantics. On the 
> > contrary, it seems preferable to keep them together.
> 
> For authoring convenience, maybe. For maintenance, no.

I would have thought they were the same.


> The problem is the same with presentational markup. If you hardwire 
> presentation into your documents, you very likely need to update 
> documents to change presentation. If you hardwire behavior (event 
> handling) into documents, you very likely need to update documents to 
> change behavior. Given that usually you’re dealing with more documents 
> (this includes dynamic templates) than style sheets or scripts, these 
> changes are more expensive.

Sure, there are limits to how much you should put into the markup. But 
things like <button onclick=""> and <body onload> or <img onload> are 
pretty harmless as far as that goes -- you're not going to change a button 
to stop responding to clicks unless you also change a lot more.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 2 September 2009 22:26:43 UTC