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

Read-only and removeChild/replaceChild

From: Watson, Christopher <CWatson@lightspan.com>
Date: Tue, 3 Jul 2001 15:43:58 -0700
Message-ID: <A65CC8B0C730D511B8340002A52CF7A2149BC4@EXCHANGE>
To: WWW DOM <www-dom@w3.org>
I've got some very basic DOM questions that I'm sure have been discussed
here before, but it's been tough searching for anything in the archives, and
I've run out of time. Thank you for your patience.

First, I wanted to verify that the read-only attribute of a Node is
implementation-specific as of DOM Level 2. DOMException provides for
NO_MODIFICATION_ALLOWED_ERR which may be raised when modifications to an
object are not allowed, but application-level determination of the read-only
state is not defined by the DOM interfaces, and must be defined by the
implementation. Is that a correct statement?

Secondly, I'm wondering about Node.removeChild. DOM2-Core specifies that
NO_MODIFICATION_ALLOWED_ERR be raised if "this node is read only." We can
assume that "this" refers to the parent of the child being removed. But what
about the child itself? If parent of the child is not read-only, and the
child being removed is read-only, wouldn't attempts to remove the child
raise the same exception? Isn't "removal" of a child akin to "modification"
of that child? Same thing can be asked of Node.replaceChild.

For that matter, when a child is removed or replaced, what is supposed to
happen to it's Node.ownerDocument?

Christopher Watson
Sr. Software Engineer
Lightspan, Inc.
Received on Tuesday, 3 July 2001 18:44:28 GMT

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