Re: [webcomponents] Considering declarative event handlers

2012-02-08 Thread Glenn Adams
On Tue, Feb 7, 2012 at 12:41 PM, Dimitri Glazkov wrote: > To make Web Components more usable, I would like to consider providing > a way to declare event handlers in markup. As I look over the use > cases and try to implement them using the proposed syntax > (http://dvcs.w3.org/hg/webcomponents/ra

Re: [webcomponents] Considering declarative event handlers

2012-02-08 Thread Erik Arvidsson
On Tue Feb 07 11:41:24 GMT-800 2012, Dimitri Glazkov wrote: > The pros are: > * It's declarative and intuitively logical I think this is a cons. Now you need both markup and code where you only had code before. This also does not scale very well and it brings us down the XBL/HTC path:

Re: [webcomponents] Considering declarative event handlers

2012-02-07 Thread Boris Zbarsky
On 2/7/12 3:25 PM, Dimitri Glazkov wrote: Oh, like

Re: [webcomponents] Considering declarative event handlers

2012-02-07 Thread Dimitri Glazkov
On Tue, Feb 7, 2012 at 12:04 PM, Erik Arvidsson wrote: > On Tue Feb 07 11:41:24 GMT-800 2012, Dimitri Glazkov > wrote: >> >> The pros are: >> * It's declarative and intuitively logical > > > I think this is a cons. Now you need both markup and code where you only had > code before. > > This also

Re: [webcomponents] Considering declarative event handlers

2012-02-07 Thread Dimitri Glazkov
On Tue, Feb 7, 2012 at 12:05 PM, Boris Zbarsky wrote: > On 2/7/12 2:41 PM, Dimitri Glazkov wrote: >> >> >>     >>         // "this" is the parent div element. >>         // "event" is the current event object. >>         if (event.target.className != 'more') >>             return; >>         if

Re: [webcomponents] Considering declarative event handlers

2012-02-07 Thread Rick Waldron
What about conflict with existing specification rules? http://dev.w3.org/html5/spec/Overview.html#the-script-element - under #12, limits the use of event and for attributes to load and window respectively. Rick On Tue, Feb 7, 2012 at 3:05 PM, Boris Zbarsky wrote: > On 2/7/12 2:41 PM, Dimit

Re: [webcomponents] Considering declarative event handlers

2012-02-07 Thread Boris Zbarsky
On 2/7/12 2:41 PM, Dimitri Glazkov wrote: // "this" is the parent div element. // "event" is the current event object. if (event.target.className != 'more') return; if (this.moreOpened) this.closeMore(); ... Thi

Re: [webcomponents] Considering declarative event handlers

2012-02-07 Thread Rick Waldron
On Tue, Feb 7, 2012 at 2:41 PM, Dimitri Glazkov wrote: > Folks, > > To make Web Components more usable, I would like to consider providing > a way to declare event handlers in markup. As I look over the use > cases and try to implement them using the proposed syntax > (http://dvcs.w3.org/hg/webcom

[webcomponents] Considering declarative event handlers

2012-02-07 Thread Dimitri Glazkov
Folks, To make Web Components more usable, I would like to consider providing a way to declare event handlers in markup. As I look over the use cases and try to implement them using the proposed syntax (http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html), a pattern emerges, wher