code: function(element) {
      var comp, rects, coords = null;
      comp = window.getComputedStyle(element, null);
      rects=element.getClientRects();
      if('none' !== comp.pointerEvents && rects.length) {
        mainLoop: for(var i=rects.length-1; i>=0; i--) {
          for(var x=rects[i].left, mX=rects[i].right; x<mX; x++) {
            for(var y=rects[i].top, mY=rects[i].bottom; y<mY; y++) {
              if(element === document.elementFromPoint(x,y)) {
                coords = {x: x, y: y};
                break mainLoop;
              }
            }
          }
        }
      }
      return coords;
    }
docs: Find a point in the viewport at wich an element can be the root of a pointer event (is not under another element)