code: function getAllRootNodesInTree(tree) {
  	let ids = [];
  
  	const rootNodes = axe.utils
  		.querySelectorAllFilter(tree, '*', node => {
  			if (ids.includes(node.shadowId)) {
  				return false;
  			}
  			ids.push(node.shadowId);
  			return true;
  		})
  		.map(node => {
  			return {
  				shadowId: node.shadowId,
  				rootNode: axe.utils.getRootNode(node.actualNode)
  			};
  		});
  
  	return axe.utils.uniqueArray(rootNodes, []);
  }
docs: Returns am array of source nodes containing `document` and `documentFragment` in a given `tree`.
  
  @param {Object} treeRoot tree
  @returns {Array<Object>} array of objects, which each object containing a root and an optional `shadowId`