/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java
selection_.setStart( ( DomNode) element_, selectionStart) ;selection_.setEnd( ( DomNode) element_, selectionEnd) ;
selection_.setEnd ( ( DomNode ) element_, selectionEnd ) ;
return selection_.getEndOffset(); } @Override public void setSelectionEnd(int selectionEnd) { final int length = element_.getText().length(); selectionEnd = Math.min(length, Math.max(selectionEnd, 0)); <extra_id_0> if (selection_.getStartOffset() > selectionEnd) { selection_.setStart((DomNode) element_, selectionEnd); } } }