RESOLVED CONFIGURATION CHANGED 22684
Creating a range with a boundary node's ancestor not in the DOM throws INVALID_NODE_TYPE_ERR
https://bugs.webkit.org/show_bug.cgi?id=22684
Summary Creating a range with a boundary node's ancestor not in the DOM throws INVAL...
Benoit Marchant
Reported 2008-12-05 10:55:46 PST
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
Attachments
test case (343 bytes, text/html)
2009-11-15 17:12 PST, Alexey Proskuryakov
no flags
Brad
Comment 1 2009-11-15 10:28:47 PST
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).
Alexey Proskuryakov
Comment 2 2009-11-15 17:12:15 PST
Created attachment 43258 [details] test case
Alexey Proskuryakov
Comment 3 2009-11-15 17:13:40 PST
Confirmed with r50998.
Alexey Proskuryakov
Comment 4 2009-11-15 17:38:08 PST
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.
Lucas Forschler
Comment 5 2019-02-06 09:03:47 PST
Mass moving XML DOM bugs to the "DOM" Component.
Ahmad Saleem
Comment 6 2023-04-11 15:10:19 PDT
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!
Note You need to log in before you can comment on or make changes to this bug.