The search functionality needs JavaScript enabled
when position is out of content bounds, fix it to nearest valid position
void correctPosition( ref TextPosition position );