code: function getRelativeRect ( rect, $container, cache ) {
          var containerPaddingRectRoot;
  
          if ( cache && cache.containerPaddingRectRoot ) {
  
              containerPaddingRectRoot = cache.containerPaddingRectRoot;
  
          } else {
              // gBCR coordinates enclose padding, and leave out margin. That is perfect for scrolling because
              //
              // - padding scrolls (ie,o it is part of the scrollable area, and gBCR puts it inside)
              // - margin doesn't scroll (ie, it pushes the scrollable area to another position, and gBCR records that)
              //
              // Borders, however, don't scroll, so they are not part of the scrollable area, but gBCR puts them inside.
              //
              // (See http://jsbin.com/pivata/10 for an extensive test of gBCR behaviour.)
  
              containerPaddingRectRoot = getPaddingRectRoot( $container[0] );
  
              // Cache the calculations
              if ( cache ) cache.containerPaddingRectRoot = containerPaddingRectRoot;
          }
  
          return {
              top: rect.top - containerPaddingRectRoot.top,
              bottom: rect.bottom - containerPaddingRectRoot.top,
              left: rect.left - containerPaddingRectRoot.left,
              right: rect.right - containerPaddingRectRoot.left
          };
      }
docs: Gets the TextRectangle coordinates relative to a container element.
  
  Do not call if the container is a window (redundant) or a document. Both calls would fail.