Bug 15892

Summary: DOM Range operations are not implemented for ProcessingInstruction nodes
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: DOMAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
proposed fix darin: review+

Description Alexey Proskuryakov 2007-11-07 22:53:11 PST
ProcessingInstruction nodes are ignored in Range.deleteContents, Range.cloneContents and Range.extractContents.

This is not a very big deal, since neither Firefox nor Opera support these operations on ProcessingInstructions. However, WebKit behavior is already different: we let Ranges start/end in ProcessingInstruction text, while other browsers raise INDEX_SIZE_ERR. Seems logical to implement the rest of the spec in this case.

<http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html>: "INDEX_SIZE_ERR: Raised if offset is negative or greater than the number of child units in refNode. Child units are 16-bit units if refNode is a type of CharacterData node (e.g., a Text or Comment node) or a ProcessingInstruction node. Child units are Nodes in all other cases."
Comment 1 Alexey Proskuryakov 2007-11-07 22:58:38 PST
Created attachment 17117 [details]
proposed fix
Comment 2 Darin Adler 2007-11-10 12:15:17 PST
Comment on attachment 17117 [details]
proposed fix

r=me
Comment 3 Alexey Proskuryakov 2007-11-10 12:27:53 PST
Committed revision 27665.
Comment 4 Lucas Forschler 2019-02-06 09:02:33 PST
Mass moving XML DOM bugs to the "DOM" Component.