code: function (a, b) {
          var ps = a, pe;
  
          while (ps) {
            pe = b;
  
            while (pe && ps != pe) {
              pe = pe.parentNode;
            }
  
            if (ps == pe) {
              break;
            }
  
            ps = ps.parentNode;
          }
  
          if (!ps && a.ownerDocument) {
            return a.ownerDocument.documentElement;
          }
  
          return ps;
        }
docs: Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
  
  @method findCommonAncestor
  @param {Element} a Element to find common ancestor of.
  @param {Element} b Element to find common ancestor of.
  @return {Element} Common ancestor element of the two input elements.