lib/third_party/tracing/ui/base/ui.js
function decorate(source, constr) {
    var elements;
    if (typeof source == 'string')
      elements = tr.doc.querySelectorAll(source);
    else
      elements = [source];

    for (var i = 0, el; el = elements[i]; i++) {
      if (!(el instanceof constr))
        constr.decorate(el);
    }
  }
function decorate(source, constr) {
    var elements;
    if (typeof source == 'string')
      elements = tr.doc.querySelectorAll(source);
    else
      elements = [source];

    for (var i = 0, el; el = elements[i]; i++) {
      if (!(el instanceof constr))
        constr.decorate(el);
    }
  }
function decorate ( source , constr ) { var elements ; if ( typeof source == 'string' ) elements = tr . doc . querySelectorAll ( source ) ; else elements = [ source ] ; for ( var 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.
Decorates elements as an instance of a class .