# HG changeset patch # User stighal@opera.com # Date 1326364377 -3600 # Branch stighal_patches_01 # Node ID c49c2da3c841a58a23daa20c35c3653840b16850 # Parent 4058e0a2965fe4aa658aed049b081a16b5967203 Collapsing a selection on a ProcessingInstruction [1], or extending a selection to a PI [2], should not throw an exception, neither according to the Selection spec nor the DOM Range spec for setting boundary points [3]. [1] http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-collapse [2] http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-extend [3] http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-range-bp-set diff -r 4058e0a2965f -r c49c2da3c841 selecttest/collapse.html --- a/selecttest/collapse.html Wed Jan 11 13:38:32 2012 -0700 +++ b/selecttest/collapse.html Thu Jan 12 11:32:57 2012 +0100 @@ -14,11 +14,10 @@ selection.addRange(addedRange); } - if (point[0].nodeType == Node.DOCUMENT_TYPE_NODE - || point[0].nodeType == Node.PROCESSING_INSTRUCTION_NODE) { + if (point[0].nodeType == Node.DOCUMENT_TYPE_NODE) { assert_throws("INVALID_NODE_TYPE_ERR", function() { selection.collapse(point[0], point[1]); - }, "Must throw INVALID_NODE_TYPE_ERR when collapse()ing if the node is a DocumentType or ProcessingInstruction"); + }, "Must throw INVALID_NODE_TYPE_ERR when collapse()ing if the node is a DocumentType"); return; } diff -r 4058e0a2965f -r c49c2da3c841 selecttest/extend.html --- a/selecttest/extend.html Wed Jan 11 13:38:32 2012 -0700 +++ b/selecttest/extend.html Thu Jan 12 11:32:57 2012 +0100 @@ -108,11 +108,10 @@ return; } - if (node.nodeType == Node.DOCUMENT_TYPE_NODE - || node.nodeType == Node.PROCESSING_INSTRUCTION_NODE) { + if (node.nodeType == Node.DOCUMENT_TYPE_NODE) { assert_throws("INVALID_NODE_TYPE_ERR", function() { selection.extend(node, offset); - }, "extend() to a doctype or PI must throw INVALID_NODE_TYPE_ERR"); + }, "extend() to a doctype must throw INVALID_NODE_TYPE_ERR"); return; }