code: function() {
        if (this.dialog_.hasAttribute('open')) {
          throw new Error('Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.');
        }
        if (!document.body.contains(this.dialog_)) {
          throw new Error('Failed to execute \'showModal\' on dialog: The element is not in a Document.');
        }
        if (!dialogPolyfill.dm.pushDialog(this)) {
          throw new Error('Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.');
        }
        this.show();
        this.openAsModal_ = true;
  
        // Optionally center vertically, relative to the current viewport.
        if (dialogPolyfill.needsCentering(this.dialog_)) {
          dialogPolyfill.reposition(this.dialog_);
          this.replacedStyleTop_ = true;
        } else {
          this.replacedStyleTop_ = false;
        }
  
        // Insert backdrop.
        this.backdrop_.addEventListener('click', this.backdropClick_);
        this.dialog_.parentNode.insertBefore(this.backdrop_,
            this.dialog_.nextSibling);
  
        // Find element with `autofocus` attribute or first form control.
        var target = this.dialog_.querySelector('[autofocus]:not([disabled])');
        if (!target) {
          // TODO: technically this is 'any focusable area'
          var opts = ['button', 'input', 'keygen', 'select', 'textarea'];
          var query = opts.map(function(el) {
            return el + ':not([disabled])';
          }).join(', ');
          target = this.dialog_.querySelector(query);
        }
        safeBlur(document.activeElement);
        target && target.focus();
      }
docs: Show this dialog modally.