W3C home > Mailing lists > Public > public-html@w3.org > May 2015

Re: Deprecated Attr methods

From: Matthew Phillips <matthew@bitovi.com>
Date: Wed, 27 May 2015 13:37:03 -0400
Message-ID: <CAHm1x+Z4x123DZ-z_y_D3NN8pmMzSbGTT9kCP2b0+6T3Mxr=1Q@mail.gmail.com>
To: Philip Jägenstedt <philipj@opera.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, public-html <public-html@w3.org>
Here's a presentation on their data-binding:
https://www.youtube.com/watch?v=-dMBcqwvYA0&feature=youtu.be&t=12m39s

However, like I said, they allow this in their templates but do not write
it to the dom (they do not call .setAttribute or attr.cloneNode()).  So
it's not an issue for them.  But I think it's something that should be
considered to allow as others will want to do similar things and may want
to write to the DOM (as I do).

On Wed, May 27, 2015 at 1:33 PM, Philip Jägenstedt <philipj@opera.com>
wrote:

> Do you have a link for how this looks and works in Angular 2? If what
> their doing would throw a wrench in the effort to simplify Attr, it
> would be good to at least discuss it with them.
>
> On Wed, May 27, 2015 at 4:58 PM, Matthew Phillips <matthew@bitovi.com>
> wrote:
> > We were planning on including it on an upcoming release of CanJS but
> looks
> > like we'll have to work-around it for now.  I'm not sure if this is a
> common
> > pattern or not.  Angular 2 is introducing this type of syntax for data
> > binding (but in their case I don't believe they are writing out the
> > attributes) so it might become more popular for other frameworks in the
> > future.
> >
> > On Mon, May 25, 2015 at 4:53 PM, Philip Jägenstedt <philipj@opera.com>
> > wrote:
> >>
> >> Interesting, I didn't know there was a discrepancy between the
> characters
> >> accepted in the HTML parser and contexts like Element.setAttribute(). It
> >> doesn't sound useful at all to limit setAttribute() more strictly than
> the
> >> parser.
> >>
> >> I've noted the problem on the tracking bug for Attr simplification in
> DOM:
> >> https://www.w3.org/Bugs/Public/show_bug.cgi?id=26609#c10
> >>
> >> Matthew, is the code that call cloneNode() on Attr objects your own, or
> is
> >> this a pattern one should expect to find a lot in the wild? It seems
> that of
> >> all the things inherited from Node to Attr, cloneNode() might be the
> most
> >> used, because apparently it's the safe way to copy attributes from one
> >> element to another.
> >>
> >> Philip
> >>
> >> On Mon, May 25, 2015 at 7:00 PM, Matthew Phillips <matthew@bitovi.com>
> >> wrote:
> >>>
> >>> Yes, this is exactly what I am doing.
> >>>
> >>> On May 25, 2015 11:43 AM, "Boris Zbarsky" <bzbarsky@mit.edu> wrote:
> >>>>
> >>>> On 5/25/15 4:29 AM, Philip Jägenstedt wrote:
> >>>>>
> >>>>> I'm not quite following, how are you setting the attribute name (not
> >>>>> value) to "[foo]"?
> >>>>
> >>>>
> >>>>   data:text/html,<div [foo]=bar>
> >>>>
> >>>> or equivalent with the innerHTML setter.
> >>>>
> >>>> Once such an attribute is created by the parser, it can currently be
> >>>> cloned and set on other elements via Attr APIs, right?  And such an
> >>>> attribute cannot be created via setAttribute/setAttributeNS.
> >>>>
> >>>> -Boris
> >>>>
> >>
> >
> >
> >
> > --
> > Bitovi
> > Development | Design | Training | Open Source
>



-- 
Bitovi
Development | Design | Training | Open Source
Received on Wednesday, 27 May 2015 17:37:31 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:46:13 UTC