packages/demos/bower_components/custom-elements/src/custom-elements.js
function _createElement(doc, tagName, options, callConstructor) {
    const customElements = _customElements();
    const element = options ? _origCreateElement.call(doc, tagName, options) :
      _origCreateElement.call(doc, tagName);
    const definition = customElements._definitions.get(tagName.toLowerCase());
    if (definition) {
      customElements._upgradeElement(element, definition, callConstructor);
    }
    customElements._observeRoot(element);
    return element;
  }
function _createElement(doc, tagName, options, callConstructor) {
    const customElements = _customElements();
    const element = options ? _origCreateElement.call(doc, tagName, options) :
      _origCreateElement.call(doc, tagName);
    const definition = customElements._definitions.get(tagName.toLowerCase());
    if (definition) {
      customElements._upgradeElement(element, definition, callConstructor);
    }
    customElements._observeRoot(element);
    return element;
  }
function _createElement ( doc , tagName , options , callConstructor ) { const customElements = _customElements ( ) ; const element = options ? _origCreateElement . call ( doc , tagName , options ) : _origCreateElement . call ( doc , tagName ) ; const definition = customElements . _definitions . get ( tagName . toLowerCase ( ) ) ; if ( definition ) { customElements . _upgradeElement ( element , definition , callConstructor ) ; } customElements . _observeRoot ( element ) ; return element ; }
Creates a new element and upgrades it if it's a custom element.
@param {!Document} doc
@param {!string} tagName
@param {Object|undefined} options
@param {boolean} callConstructor whether or not to call the elements
constructor after upgrading. If an element is created by calling its
constructor, then `callConstructor` should be false to prevent double
initialization.
Creates a new element and upgrades it if it s a custom element .