         break
     this
 
-  ##
-  # Convert this range into an object consisting of
-  # two pairs of (xpath, character offset), which
-  # can be easily stored in a database.
-  #
-  # @param {Element} root The root element relative to which XPaths should be calculated
+  # Convert this range into an object consisting of two pairs of (xpath,
+  # character offset), which can be easily stored in a database.
+  #
+  # root -           The root Element relative to which XPaths should be calculated
+  # ignoreSelector - A selector String of elements to ignore. For example
+  #                  elements injected by the annotator.
+  #
+  # Returns an instance of SerializedRange.
   serialize: (root, ignoreSelector) ->
 
     serialization = (node, isEnd) ->


    new Range.BrowserRange(range).normalize(root)

  serialize: (root, ignoreSelector) ->
    this.normalize(root).serialize(root, ignoreSelector)

  toObject: ->
    {
      start: @start

    console.error("Couldn't not sniff range type")
    false

# Public: Creates a wrapper around a range object obtained from a DOMSelection.
class Range.BrowserRange

  # Public: Creates an instance of BrowserRange.
  #
  # object - A range object obtained via DOMSelection#getRangeAt().
  #
  # Examples
  #
  #   selection = window.getSelection()
  #   range = new Range.BrowserRange(selection.getRangeAt(0))
  #
  # Returns an instance of BrowserRange.
  constructor: (obj) ->
    @commonAncestorContainer = obj.commonAncestorContainer
    @startContainer          = obj.startContainer
