Fix getLocationInView atom for documentElement
When webdriver.chrome.getLocationInView atom is passed the <html>
element (i.e., document.documentElement), it throws an error since
the parent node is not an element. This causes ChromeDriver bug
Add check for this condition.
@@ -171,6 +171,7 @@ webdriver.chrome.getLocationInView = function(elem, center, opt_region) {
if (!region)
region = new goog.math.Rect(0, 0, elem.offsetWidth, elem.offsetHeight);
+ if (elem != document.documentElement)
webdriver.chrome.scrollIntoView_(elem, region, center);
var elemClientPos = goog.style.getClientPosition(elem);
