lib/commons/color/get-background-color.js
function sortPageBackground(elmStack) {
	let bodyIndex = elmStack.indexOf(document.body);
	let bgNodes = elmStack;

	if (
		// Check that the body background is the page's background
		bodyIndex > 1 && // only if there are negative z-index elements
		!color.elementHasImage(document.documentElement) &&
		color.getOwnBackgroundColor(
			window.getComputedStyle(document.documentElement)
		).alpha === 0
	) {
		// Remove body and html from it's current place
		bgNodes.splice(bodyIndex, 1);
		bgNodes.splice(elmStack.indexOf(document.documentElement), 1);

		// Put the body background as the lowest element
		bgNodes.push(document.body);
	}
	return bgNodes;
}
function sortPageBackground(elmStack) {
	let bodyIndex = elmStack.indexOf(document.body);
	let bgNodes = elmStack;

	if (
		// Check that the body background is the page's background
		bodyIndex > 1 && // only if there are negative z-index elements
		!color.elementHasImage(document.documentElement) &&
		color.getOwnBackgroundColor(
			window.getComputedStyle(document.documentElement)
		).alpha === 0
	) {
		// Remove body and html from it's current place
		bgNodes.splice(bodyIndex, 1);
		bgNodes.splice(elmStack.indexOf(document.documentElement), 1);

		// Put the body background as the lowest element
		bgNodes.push(document.body);
	}
	return bgNodes;
}
function sortPageBackground ( elmStack ) { let bodyIndex = elmStack . indexOf ( document . body ) ; let bgNodes = elmStack ; if ( // Check that the body background is the page's background bodyIndex > 1 && // only if there are negative z-index elements ! color . elementHasImage ( document . documentElement ) && color . getOwnBackgroundColor ( window . getComputedStyle ( document . documentElement ) ) . alpha === 0 ) { // Remove body and html from it's current place bgNodes . splice ( bodyIndex , 1 ) ; bgNodes . splice ( elmStack . indexOf ( document . documentElement ) , 1 ) ; // Put the body background as the lowest element bgNodes . push ( document . body ) ; } return bgNodes ; }
Look at document and body elements for relevant background information
@method sortPageBackground
@private
@param {Array} elmStack
@returns {Array}
Look at document and body elements for relevant background information