Re: Setting EntityReference.nodeValue and EntityReference.prefix

[adding the Web API Group since thy are the ones who work on the
maintenance of the DOM Level 3 Core nowadays]

Summary:

setting Node.prefix when it is defined to be null is a no-op. it
shouldn't raise an exception.

So, for Node.prefix, it should read:
[[
NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly and if it
is not defined to be null.
]]

On Tue, 2008-02-05 at 22:21 -0800, Eric Seidel wrote:
> EntityReferences are always readonly nodes.  The spec seems ambiguous  
> here.  The main text for each property would suggest that neither  
> should raise if the property value is always defined to be null.   
> However, the exception explanations suggest that entityRef.nodeValue =  
> 'foo' should not raise (silently fail) and yet entityRef.prefix =  
> "foo" should fail with NO_MODIFICATION_ALLOWED_ERR.

It's an error in the DOM Level 3 specification. If you look at DOM Level
2, nodeValue and prefix says:
[[
nodeValue
 When it is defined to be null, setting it has no effect.
 DOMException
  NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

prefix
 The namespace prefix of this node, or null if it is unspecified.
 DOMException
  NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
]]
http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247

Looking at our internal archives, Elena Litani raised the issue on
nodeValue in February 2002. In September 2003, Johnny Stenback raised
the issue on prefix [1]. The resolution for prefix was:
"It is a no-op, similar to Node value."

We forgot to modify the exception as well when we changed the general
text and the editor of the spec (me in this case) didn't catch the
discrepancy.

Regards,

Philippe

[1] http://www.w3.org/2003/06/09-dom-core-issues/issues.html#stenback-1

Received on Wednesday, 6 February 2008 18:34:03 UTC