W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

Re: Improving the DOM

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 08 Nov 2011 14:54:51 -0700
To: "Olli Pettay" <Olli.Pettay@helsinki.fi>, olli@pettay.fi
Cc: www-dom@w3.org
Message-ID: <op.v4nglpuo64w2qv@annevk-macbookpro.local>
On Tue, 08 Nov 2011 15:41:09 -0700, Olli Pettay <Olli.Pettay@helsinki.fi>  
> On 11/08/2011 11:30 PM, Anne van Kesteren wrote:
>> We introduce a DocumentContent union type (DOMString maps to a Text  
>> node):
> DOMString as Text node feels quite awkward. All the JS strings in a web
> page would have .previous/nextSibling properties?

The plan is to define that passing a DOMString to a method that takes  
DocumentContent results in a Text node being created with the contents of  
the DOMString.

>> We introduce these methods on Element, DocumentFragment, and  
>> CharacterData:
>> before(DocumentContent... nodes)
>> after(DocumentContent... nodes)
> I don't quite understand what these would do. Something like  
> insertBefore?

Yes. The put nodes before and after the node they are invoked on.

>> We introduce this method on Element and CharacterData:
>> replace(DocumentContent... nodes)
> What would CharacterData.replace(someelement) do?

If it's e.g. a Text node it would be replaced by an Element node.

Anne van Kesteren
Received on Tuesday, 8 November 2011 22:55:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:36:59 UTC