function htmlTreeAsString(elem) {
	    /* eslint no-extra-parens:0*/
	    var MAX_TRAVERSE_HEIGHT = 5,
	        MAX_OUTPUT_LEN = 80,
	        out = [],
	        height = 0,
	        len = 0,
	        separator = ' > ',
	        sepLength = separator.length,
	        nextStr;

	    while (elem && height++ < MAX_TRAVERSE_HEIGHT) {

	        nextStr = htmlElementAsString(elem);
	        // bail out if
	        // - nextStr is the 'html' element
	        // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
	        //   (ignore this limit if we are on the first iteration)
	        if (nextStr === 'html' || height > 1 && len + (out.length * sepLength) + nextStr.length >= MAX_OUTPUT_LEN) {
	            break;
	        }

	        out.push(nextStr);

	        len += nextStr.length;
	        elem = elem.parentNode;
	    }

	    return out.reverse().join(separator);
	}
Given a child DOM element, returns a query-selector statement describing that
and its ancestors
e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
@param elem
@returns {string}