Re: Questions about replaceWholeText

"Vadim O. Ustiansky" <ustiansk@sai.msu.ru> wrote:

> I am new to DOM and after reading the specification of
> replaceWholeText method I have several questions. I suspect
> them to be caused by my poor English

I don't know, I found some of the wording of the wholeText stuff a little
hairy too!

I can't speak for the Editors, but this is my understanding of
replaceWholeText and how I have implemented it in pxdom.

>   1) What is null when the replacement text is empty?
>      Is it method's return value or returned node's text
>      content that is null?

The return value. If the whole text is replaced by no text, there will
be no Text node left to return, which is why we get null.

>   2) Suppose I have three logically-adjacent text nodes
>      (N1, N2, N3). Let N2 be readonly and the others are
>      not readonly. If I call replaceWholeText('some text') on
>      N2 what result should I expect?

N4, containing text 'some text'. N1, N2 and N3 will be removed from the
document. In N2's case its parent EntityReference will be removed instead
of N2 itself (assuming that is the reason for N2 being readonly).

-- 
Andrew Clover
mailto:and@doxdesk.com
http://www.doxdesk.com/

Received on Wednesday, 10 September 2003 03:50:49 UTC