   getDOMRange = ->
     getDOMSelection()?.getRangeAt(0)
 
+  getClientRects = ->
+    rects = getDOMRange()?.getClientRects()
+    rects if rects?.length
+
   # ClientRect position properties should be relative to the viewport,
   # but in some browsers (like mobile Safari), they're relative to the body.
   getRectTop = ->

      "backward"
    else if range.compareBoundaryPoints(Range.END_TO_END, previousRange) is 1
      "forward"

      else
        textRange.moveStart(granularity, -1)
      textRange.select()
    @selectionObserver.tick()

  # TODO: Combine with #expandSelectionInDirectionWithGranularity and add IE compatibility
  adjustSelectionInDirectionWithGranularity: (direction, granularity) ->
    return unless selection = getDOMSelection()
    alter = if selection.isCollapsed then "move" else "extend"
    selection.modify(alter, direction, granularity)
    @selectionObserver.tick()

  lock: ->
    if @lockCount++ is 0
