/src/main/java/org/htmlunit/html/impl/SimpleRange.java
if ( startOffset_ > -1) {
if ( startOffset_ > -1 && startOffset_ < text.length ( ) ) {
private void deleteContents(final DomNode ancestor) { final DomNode start; final DomNode end; if (isOffsetChars(startContainer_)) { start = startContainer_; String text = getText(start); <extra_id_0> text = text.substring(0, startOffset_); } setText(start, text); } else if (startContainer_.getChildNodes().getLength() > startOffset_) { start = (DomNode) startContainer_.getChildNodes().item(startOffset_);