Creating a range with boundary a node for which an ancestor is not actually in the DOM throw an INVALID_NODE_TYPE_ERR exception : var hiddenDOMRange = window.document.createRange(), startNode = ... /*a DOM node for which one of it's ancestor has a parentNode null, although they have the right ownerDocument*/; hiddenDOMRange.setStartBefore(startNode);//This call will throw an exception Works as expected in FireFox
Is there any progress on this bug? I am encountering it when using tinyMCE. Reproduction: In a tinymce editor, add a table, some rows and some columns. Then, for that editor, call getContent (in tinymce).
Created attachment 43258 [details] test case
Confirmed with r50998.
Looks like WebKit behavior is correct per <http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html> though: "INVALID_NODE_TYPE_ERR: Raised if the root container of refNode is not an Attr, Document, or DocumentFragment node or if refNode is a Document, DocumentFragment, Attr, Entity, or Notation node." In the attached test case, root container is an Element node. Also, "... the content of a Range must be entirely within the subtree rooted by a single Document, DocumentFragment or Attr Node", per paragraph 2.2.1.
Mass moving XML DOM bugs to the "DOM" Component.
All browsers (Safari 16.4, Chrome Canary 114 and Firefox Nightly 114) show alert with "No Exception", do we need to do anything here or we can mark this as "RESOLVED CONFIGURATION CHANGED"? Thanks!