W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2003

Re: Questions about replaceWholeText

From: Andrew Clover <and-w3@doxdesk.com>
Date: Wed, 10 Sep 2003 07:36:33 +0000
To: www-dom@w3.org
Message-ID: <20030910073633.GA27392@doxdesk.com>

"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
Received on Wednesday, 10 September 2003 03:50:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:11 UTC