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

Re: Improving the DOM

From: Jake Verbaten <raynos2@gmail.com>
Date: Wed, 9 Nov 2011 01:47:37 +0000
Message-ID: <CAMCMjp35=HPkJDM3ef_diRXCSPWM6ZY--=62k1=PjDKCaqvTiA@mail.gmail.com>
To: Sean Hogan <shogun70@westnet.com.au>
Cc: Anne van Kesteren <annevk@opera.com>, www-dom@w3.org
On Wed, Nov 9, 2011 at 1:38 AM, Sean Hogan <shogun70@westnet.com.au> wrote:

> On 9/11/11 8:30 AM, Anne van Kesteren wrote:
>
>> Here is a revised proposal based on Ojan's earlier proposal to this list.
>> These new methods are subject to compatibility testing.
>>
>> We introduce a DocumentContent union type (DOMString maps to a Text node):
>>
>> DOMString | CharacterData | Element | DocumentFragment
>>
>> We introduce these methods on Element and DocumentFragment:
>>
>> prepend(DocumentContent... nodes)
>> append(DocumentContent... nodes)
>>
>> We introduce these methods on Element, DocumentFragment, and
>> CharacterData:
>>
>> before(DocumentContent... nodes)
>> after(DocumentContent... nodes)
>>
>> We introduce this method on Element and CharacterData:
>>
>> replace(DocumentContent... nodes)
>>
>> We introduce this method on DocumentType, Element, and CharacterData:
>>
>> remove()
>>
>>
>>
> A couple of questions:
>
> 1. What value will these methods return?


This may be an opportunity to mimic some of the DOM libraries and return
the node they operated on thus allowing chaining. If we don't want that
then we would have to somehow return all of the DocumentContent nodes (or
the first/last one, or void)


> 2. I assume that before, after, replace and remove all throw if the node
> has no parentNode?
>
> Sean
>
>
>
Received on Wednesday, 9 November 2011 01:48:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT