code: function( rootId ) {
          startingState.roots[ rootId ] = {};
          startingState.roots[ rootId ].steps = [];
  
          // Record whether the steps have an id or not
          var steps = document.getElementById( rootId ).querySelectorAll( ".step" );
          for ( var i = 0; i < steps.length; i++ ) {
              var el = steps[ i ];
              startingState.roots[ rootId ].steps.push( {
                  el: el,
                  id: el.getAttribute( "id" )
              } );
          }
  
          // In the rare case of multiple roots, the following is changed on first init() and
          // reset at last tear().
          if ( rootsCount === 0 ) {
              startingState.body = {};
  
              // It is customary for authors to set body.class="impress-not-supported" as a starting
              // value, which can then be removed by impress().init(). But it is not required.
              // Remember whether it was there or not.
              if ( document.body.classList.contains( "impress-not-supported" ) ) {
                  startingState.body.impressNotSupported = true;
              } else {
                  startingState.body.impressNotSupported = false;
              }
  
              // If there's a <meta name="viewport"> element, its contents will be overwritten by init
              var metas = document.head.querySelectorAll( "meta" );
              for ( i = 0; i < metas.length; i++ ) {
                  var m = metas[ i ];
                  if ( m.name === "viewport" ) {
                      startingState.meta = m.content;
                  }
              }
          }
      }
docs: CORE INIT The library factory (gc(rootId)) is called at the beginning of impress(rootId).init() For the purposes of teardown(), we can use this as an opportunity to save the state of a few things in the DOM in their virgin state, before impress().init() did anything. Note: These could also be recorded by the code in impress.js core as these values are changed, but in an effort to not deviate too much from upstream, I'm adding them here rather than the core itself.