Selection is based in DOM tree, so if you select text from "green" to "red" the highlighted area is exactly the opposite to what the user is actually selecting.