This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The latest draft spec says: Invoking the cloneNode() method on a ShadowRoot instance must always throw a HIERARCHY_REQUEST_ERR exception. But according to Node's IDL definition, http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247 Node cloneNode(in boolean deep); It seems cloneNode must not throw DOMException. Is it okay to throw DOMException in case of ShadowRoot?
Sure, why not? If you'd like, I can redefine cloneNode on ShadowRoot in the IDL?
If that's okay and commonly used in IDL world, I do not mind. :) I just afraid that it seems to violate substitution principle of inheritance in general. Fo example, if DOMException should be considered a 'checked' exception (I borrowed the word from Java) , it violates substitution principal. Subclass can not override a method so that it add a checked Exception which is not declared in superclass's signature. In IDL world, I am not sure whether we should keep this rule or not. I just want to make sure that is okay in IDL. (In reply to comment #1) > Sure, why not? If you'd like, I can redefine cloneNode on ShadowRoot in the > IDL?
The thing is that cloneNode _does_ indeed throw an exception for DocumentFragments: http://www.w3.org/TR/2011/WD-domcore-20110531/#clone I think the IDL is just wrong. I'll file a bug against domcore.
Thank you. I agree that either the spec or the implementation must be fixed if DocumentFragment's cloneNode might throw DOMException. I cannot find any spec that DocumentFragment's cloneNode may throw DOMException. (In reply to comment #3) > The thing is that cloneNode _does_ indeed throw an exception for > DocumentFragments: http://www.w3.org/TR/2011/WD-domcore-20110531/#clone > > I think the IDL is just wrong. I'll file a bug against domcore.
Renaming the bug to keep in sync with DOM Core.
http://dvcs.w3.org/hg/webcomponents/rev/75b4cc4d3efa