function decorate(source, constr) {
    let elements;
    if (typeof source == 'string') elements = cr.doc.querySelectorAll(source);
    else elements = [source];

    for (let i = 0, el; (el = elements[i]); i++) {
      if (!(el instanceof constr)) constr.decorate(el);
    }
  }
Decorates elements as an instance of a class.
@param {string|!Element} source The way to find the element(s) to decorate.
    If this is a string then {@code querySeletorAll} is used to find the
    elements to decorate.
@param {!Function} constr The constructor to decorate with. The constr
    needs to have a {@code decorate} function.