This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Created attachment 1066 [details] Test patch, index According to the Selection spec for extend [1], the checking of offset compared to parentNode's length should be done before setting the new boundary points for the range [2] which would trigger the node type exception for doctype. In the selecttest/extend.html tests there are a few tests that expect the browser to throw an INVALID_NODE_TYPE_ERR, where in fact the INDEX_SIZE_ERR exception should be checked and thrown first. Patch attached. [1] http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-extend [2] http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-range-bp-set
Actually, it seems like I should just reference DOM4's "set the start or end" algorithm for simplicity. This results in throwing InvalidNodeTypeError first. This: document.createRange().setStart(document.doctype, -13); throws InvalidNodeTypeError in Firefox 12.0a1 and Chrome 17 dev, per DOM4; and IndexSizeError in IE9 and Opera Next 12.00 alpha, not per DOM4. We should be consistent and throw InvalidNodeTypeError for extend() just like setStart(). I've changed the spec to reference DOM4's algorithm, which I believe makes the tests correct: http://dvcs.w3.org/hg/editing/rev/0ef300a5c14f Please tell me if this isn't satisfactory. Thanks!
(In reply to comment #1) ... > Please tell me if this isn't satisfactory. Thanks! The changes look very good. Thank you for quick response. Just FYI, I'm currently rewriting the Range and Selection code in Opera, and upcoming versions will match the spec, more or less, to the letter.
Great! Opera's Range/Selection implementation was always a not-so-good match for the other browsers I tested, and I hope my spec/tests are helpful in improving that. Please give me any further feedback you have and I'll try to respond ASAP.