Re: Improving the DOM; rev 2

On Fri, 18 Nov 2011 14:02:59 +0100, Anne van Kesteren <annevk@opera.com>  
wrote:
> The next question is whether we should impose restrictions on these  
> methods at the IDL or method implementation level. E.g. appending a  
> DocumentType to Document can be fine, but appending it to Element is  
> never fine. Also currently you know that appendChild(DocumentFragment)  
> on an Element is going to work. With these vararg methods you do not,  
> unless the arguments are restricted at the IDL level, or otherwise at  
> the method implementation level. I no longer feel strongly where we do  
> this, but I believe Ojan had some concerns with respect to performance.

I ended up defining these methods in terms of the existing mutation  
algorithms which simplified things a fair bit:  
http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#mutation-methods

This means you can do exactly the same with them as you can do today,  
except it's a whole lot simpler to develop with.


The new methods require new IDL syntax. You can follow the process on that  
in this bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14188


> As to what these methods return, we should probably go with chaining.  
> I'm not a big fan, but it seems to be what all the cool kids are doing  
> these days, and the cost is negligible.

http://blog.mozilla.com/dherman/2011/12/01/now-thats-a-nice-stache/  
convinced me not to add chaining for now. If people feel strongly we  
should add chaining all over the platform, and maybe we should, lets have  
a discussion on public-script-coord@w3.org first.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Monday, 5 December 2011 14:10:39 UTC