function getRelativeBoundingRect (els, containerEl) {
  let nativeCotainerEl
  if (containerEl._isDOMElement) {
    nativeCotainerEl = containerEl.getNativeElement()
  } else {
    nativeCotainerEl = containerEl
  }
  if (!isArray(els)) els = [els]
  const elRects = els.map((el) => {
    let nativeEl
    if (el._isDOMElement) {
      nativeEl = el.getNativeElement()
    } else {
      nativeEl = el
    }
    return _getBoundingOffsetsRect(nativeEl, nativeCotainerEl)
  })

  const elsRect = _getBoundingRect(elRects)
  const containerElRect = nativeCotainerEl.getBoundingClientRect()
  return {
    left: elsRect.left,
    top: elsRect.top,
    right: containerElRect.width - elsRect.left - elsRect.width,
    bottom: containerElRect.height - elsRect.top - elsRect.height,
    width: elsRect.width,
    height: elsRect.height
  }
}
Get bounding rectangle relative to a given parent element. Allows multiple
  elements being passed (we need this for selections that consist of multiple
  selection fragments). Takes a relative parent element that is used as a
  reference point, instead of the browser's viewport.

  @param {DOMElement[]} els elements to compute the bounding rectangle for
  @param {DOMElement} containerEl relative parent used as a reference point
  @return {object} rectangle description with left, top, right, bottom, width and height