Selection is a set of ranges. It has a direction specified by its
anchor and focus
(it can be forward or backward).
Additionally, selection may have its own attributes (think – whether text typed in in this selection
should have those attributes – e.g. whether you type a bolded text).