lib/core/utils/preload-cssom.js
function getStylesheetsFromDocumentFragment(options) {
	const { rootNode, convertDataToStylesheet } = options;
	return (
		Array.from(rootNode.children)
			.filter(filerStyleAndLinkAttributesInDocumentFragment)
			// Reducer to convert `<style></style>` and `<link>` references to `CSSStyleSheet` object
			.reduce((out, node) => {
				const nodeName = node.nodeName.toUpperCase();
				const data = nodeName === 'STYLE' ? node.textContent : node;
				const isLink = nodeName === 'LINK';
				const stylesheet = convertDataToStylesheet({
					data,
					isLink,
					root: rootNode
				});
				out.push(stylesheet.sheet);
				return out;
			}, [])
	);
}
function getStylesheetsFromDocumentFragment(options) {
	const { rootNode, convertDataToStylesheet } = options;
	return (
		Array.from(rootNode.children)
			.filter(filerStyleAndLinkAttributesInDocumentFragment)
			// Reducer to convert `<style></style>` and `<link>` references to `CSSStyleSheet` object
			.reduce((out, node) => {
				const nodeName = node.nodeName.toUpperCase();
				const data = nodeName === 'STYLE' ? node.textContent : node;
				const isLink = nodeName === 'LINK';
				const stylesheet = convertDataToStylesheet({
					data,
					isLink,
					root: rootNode
				});
				out.push(stylesheet.sheet);
				return out;
			}, [])
	);
}
function getStylesheetsFromDocumentFragment ( options ) { const { rootNode , convertDataToStylesheet } = options ; return ( Array . from ( rootNode . children ) . filter ( filerStyleAndLinkAttributesInDocumentFragment ) // Reducer to convert `<style></style>` and `<link>` references to `CSSStyleSheet` object . reduce ( ( out , node ) => { const nodeName = node . nodeName . toUpperCase ( ) ; const data = nodeName === 'STYLE' ? node . textContent : node ; const isLink = nodeName === 'LINK' ; const stylesheet = convertDataToStylesheet ( { data , isLink , root : rootNode } ) ; out . push ( stylesheet . sheet ) ; return out ; } , [ ] ) ) ; }
Get stylesheets from `documentFragment`

@param {Object} options configuration options of `loadCssom`
@returns {Array<Object>}
Get stylesheets from documentFragment