Re: Some way to change an element's name would be useful

2011-08-30 Thread Robin Berjon
On Aug 29, 2011, at 23:29 , Dimitri Glazkov wrote: Document.renameNode seems cool. Aside from the awkward user data event, it matches perfectly the needs of the Component Model (updated to reference it here: http://wiki.whatwg.org/wiki/Component_Model#Performance). I am curious why no one

Re: Some way to change an element's name would be useful

2011-08-30 Thread Aryeh Gregor
I filed a bug against DOM Core: http://www.w3.org/Bugs/Public/show_bug.cgi?id=13971

Re: Some way to change an element's name would be useful

2011-08-30 Thread Karl Dubost
Le 29 août 2011 à 14:57, Aryeh Gregor a écrit : In editing, it's common to want to change an element's name. For instance, document.execCommand(formatblock, false, h1) will change the current line's wrapper to an h1. Unbolding b id=foo should produce span id=foo. Does that also mean that

Re: Some way to change an element's name would be useful

2011-08-30 Thread Aryeh Gregor
On Tue, Aug 30, 2011 at 4:44 PM, Karl Dubost ka...@opera.com wrote: Le 29 août 2011 à 14:57, Aryeh Gregor a écrit : In editing, it's common to want to change an element's name.  For instance, document.execCommand(formatblock, false, h1) will change the current line's wrapper to an h1.  

Some way to change an element's name would be useful

2011-08-29 Thread Aryeh Gregor
In editing, it's common to want to change an element's name. For instance, document.execCommand(formatblock, false, h1) will change the current line's wrapper to an h1. Unbolding b id=foo should produce span id=foo. My editing spec defines an algorithm for this

Re: Some way to change an element's name would be useful

2011-08-29 Thread Robin Berjon
On Aug 29, 2011, at 20:57 , Aryeh Gregor wrote: We can't actually change the tag name of the node in place, because then it will have to implement a different interface in general. But we could have a setTagName() method that creates a new Element with the given tag name, moves the children,

Re: Some way to change an element's name would be useful

2011-08-29 Thread Boris Zbarsky
On 8/29/11 3:33 PM, Robin Berjon wrote: For completeness, I'm guessing that namespaces would be supported as well? Element renameElement(DOMString newName); Element renameElement(DOMString newNS, DOMString newName); Shades of

Re: Some way to change an element's name would be useful

2011-08-29 Thread Aryeh Gregor
On Mon, Aug 29, 2011 at 3:40 PM, Boris Zbarsky bzbar...@mit.edu wrote: Shades of http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode That has some good catches I hadn't thought of -- it preserves event handlers and custom JS attributes too.

Re: Some way to change an element's name would be useful

2011-08-29 Thread Glenn Maynard
On Mon, Aug 29, 2011 at 4:29 PM, Aryeh Gregor a...@aryeh.name wrote: On Mon, Aug 29, 2011 at 3:40 PM, Boris Zbarsky bzbar...@mit.edu wrote: Shades of http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode That has some good catches I hadn't thought of -- it preserves event

Re: Some way to change an element's name would be useful

2011-08-29 Thread Robin Berjon
On Aug 29, 2011, at 21:40 , Boris Zbarsky wrote: On 8/29/11 3:33 PM, Robin Berjon wrote: For completeness, I'm guessing that namespaces would be supported as well? Element renameElement(DOMString newName); Element renameElement(DOMString newNS, DOMString newName); Shades of

Re: Some way to change an element's name would be useful

2011-08-29 Thread Boris Zbarsky
On 8/29/11 4:53 PM, Robin Berjon wrote: On Aug 29, 2011, at 21:40 , Boris Zbarsky wrote: On 8/29/11 3:33 PM, Robin Berjon wrote: For completeness, I'm guessing that namespaces would be supported as well? Element renameElement(DOMString newName); Element renameElement(DOMString newNS,

Re: Some way to change an element's name would be useful

2011-08-29 Thread Dimitri Glazkov
Document.renameNode seems cool. Aside from the awkward user data event, it matches perfectly the needs of the Component Model (updated to reference it here: http://wiki.whatwg.org/wiki/Component_Model#Performance). I am curious why no one had implemented this. We should dust it off, add a normal