Re: Improving the DOM

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?

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:39:03 UTC