Re: Attr nodes

Don't confuse IDL attributes with implementation fields. An IDL attribute
is just a value you can read or set. Where it's stored is a completely
separate issue, and is up to the implementation.

The DOM API says that the Attr node's value is always equal to the
concatenation of the values of its Text descendents, and that when you set
this node's value that's taken as a request to replace those descendents
with a single Text node containing the new value. I don't think we actually
said whether it will be a new Text node, or whether one of the existing
Text children of the Attr (if any) will be reused by having the new value
assigned to it. I believe either is acceptable.

So setting this value changes the Attr's children, and changes the Attr's
node value because that value is derived from the children.


Whether this involves changing a value field inside the Attr is an
implementation issue. Some implementations may want to cache the Attr's
node value rather than doing the concatenation each time it's called for.
An implementation which does so must deal with updating that cache when the
Attr's children are changed, either by manipulating them directly or by
setting the Attr node's value... but that's all invisible to the DOM user.


______________________________________
Joe Kesselman  / IBM Research

Received on Thursday, 14 February 2002 13:21:39 UTC