Repair work of selectionStart/selectionEnd properties for inputs and textareas
The properties selectionStart and selectionEnd work incorrectly. Their values fail to match the real selection state after certain operations with elements (inputs and textareas).
Consider a page with an input element (type="text", value="12345", not activeElement). After you call el.setSelectionRange(2,2), what you get is el.selectionStart = 0 although the cursor is positioned correctly.