Returns True if the selector's element is located in an iframe.
            Otherwise returns False.
166447
def is_element_in_an_iframe(self, selector, by=By.CSS_SELECTOR):
        
        selector, by = self.__recalculate_selector(selector, by)
        if self.is_element_present(selector, by=by):
            return False
        soup = self.get_beautiful_soup()
        iframe_list = soup.select('iframe')
        for iframe in iframe_list:
            iframe_identifier = None
            if iframe.has_attr('name') and len(iframe['name']) > 0:
                iframe_identifier = iframe['name']
            elif iframe.has_attr('id') and len(iframe['id']) > 0:
                iframe_identifier = iframe['id']
            else:
                continue
            self.switch_to_frame(iframe_identifier)
            if self.is_element_present(selector, by=by):
                self.switch_to_default_content()
                return True
            self.switch_to_default_content()
        return False
258180
public static boolean hasBorder(Element element) {

        String borderStyle = CmsDomUtil.getCurrentStyle(element, Style.borderStyle);
        if ((borderStyle == null) || borderStyle.equals(StyleValue.none.toString()) || (borderStyle.length() == 0)) {
            return false;
        }
        return true;

    }
20380
function (selector, done) {
  this.evaluate_now((selector) => {
    let element = document.querySelector(selector)
    if (!element) {
      return false
    }

    for (let key in element) {
      if (key.startsWith('__reactInternalInstance$')) {
        return true
      }
    }

    return false
  }, done, selector)
}
1367765
function is(node, selector) {
    return (node.matches
            || node.webkitMatchesSelector
            || node.mozMatchesSelector
            || node.msMatchesSelector
            || node.oMatchesSelector).call(node, selector);
}
127589
function matches (el, selector) {
  var _matches = el.matches ||
    el.matchesSelector ||
    el.msMatchesSelector ||
    el.mozMatchesSelector ||
    el.webkitMatchesSelector ||
    el.oMatchesSelector

  if (_matches) {
    return _matches.call(el, selector)
  } else if (el.parentNode) {
    // IE8 and below
    var nodes = el.parentNode.querySelectorAll(selector)
    for (var i = nodes.length; i--; 0) {
      if (nodes[i] === el) return true
    }
    return false
  }
}
516353
function isSimpleIndentationElement(node) {
	if (!isIndentationElement(node)) {
		return false;
	}

	for (var i = 0; i < node.attributes.length; i++) {
		if (!isHtmlNamespace(node.attributes[i].namespaceURI)
		|| ["style", "dir"].indexOf(node.attributes[i].name) == -1) {
			return false;
		}
	}

	for (var i = 0; i < node.style.length; i++) {
		// This is approximate, but it works well enough for my purposes.
		if (!/^(-[a-z]+-)?(margin|border|padding)/.test(node.style[i])) {
			return false;
		}
	}

	return true;
}
324230
function(selector)
	{
		var el = this.__obj;
		
		if (el)
		{
			var matchesFn;
			
			['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn) 
			{
				if (typeof document.body[fn] == 'function') 
				{
					matchesFn = fn;
					return true;
				}
				
				return false;
			});
			
			var parent;
			
			// traverse parents
			while (el)
			{
				parent = el.parentElement;
				
				if (parent && parent[matchesFn](selector)) 
				{
					return parent;
				}
				
				el = parent;
			}
		}
	}
837378
def is_root(self, el):
        

        root = self.root and self.root is el
        if not root:
            parent = self.get_parent(el)
            root = parent is not None and self.is_html and self.is_iframe(parent)
        return root
1078356
function (selector, root) {
        if (!isElement(root)) {
            return null
        }

        var Closest = Element.prototype.closest ||
            function (sel) {
                var element = this;
                if (!document.documentElement.contains(element)) {
                    return null
                }

                do {
                    if (element.matches(sel)) {
                        return element
                    }

                    element = element.parentElement;
                } while (element !== null)

                return null
            };

        var el = Closest.call(root, selector);

        return el === root ? null : el
    }
575865
function isIndentationElement(node) {
	if (!isHtmlElement(node)) {
		return false;
	}

	if (node.tagName == "BLOCKQUOTE") {
		return true;
	}

	if (node.tagName != "DIV") {
		return false;
	}

	for (var i = 0; i < node.style.length; i++) {
		// Approximate check
		if (/^(-[a-z]+-)?margin/.test(node.style[i])) {
			return true;
		}
	}

	return false;
}
1023062
def scroll_element_into_view(self, selector):
        
        element = selector
        if isinstance(element, WebElement):
            self.execute_script("arguments[0].scrollIntoView( true );", element)
        else:
            self.execute_script("$('{}')[0].scrollIntoView( true );".format(selector[1]))
890580
def is_focused(self):
        
        active_el = self.browser.execute_script("return document.activeElement")
        query_results = self.map(lambda el: el == active_el, 'focused').results

        if query_results:
            return any(query_results)
        return False
246495
def is_xpath_selector(selector):
    
    if (selector.startswith('/') or selector.startswith('./') or (
            selector.startswith('('))):
        return True
    return False
1316782
public static final boolean isMouseInside(NativeEvent event, Element element) {
        return isInside(event.getClientX() + Window.getScrollLeft(), event.getClientY() + Window.getScrollTop(), getBounds(element));
    }
139155
function querySelectorOnBrowser(selector) {
        // stupid error catching here to stop the browser from printing null cannot be found to stdout
        var query;
        try {
            // do this to simulate a scroll to the bottom of the page to trigger loading of certain ajax elements
            //todo somehow this still doesnt work
            document.body.scrollTop = 0;
            document.body.scrollTop = 9999999999;
            //window.document.body.scrollTop = document.body.scrollHeight;
            query = document.querySelector(selector).innerHTML;

        } catch (exception) {
            return false;
        }
        return true;
    }
1132853
function() {
  if (!global.document) {
    return true;
  }
  return global.document.documentElement.compareDocumentPosition ?
    function (a, b) {
      return !!(a.compareDocumentPosition(b) & 16);
    } :
    global.document.documentElement.contains ?
      function (a, b) {
        return a !== b && ( a.contains ? a.contains(b) : false );
      } :
      function (a, b) {
        while (b = b.parentNode) {
          if (b === a) {
            return true;
          }
        }
        return false;
      };
}
1085782
boolean hasChildElement() {
        org.w3c.dom.NodeList nodes = this.dom.getChildNodes();
        for (int i=0; i<nodes.getLength(); i++) {
            if (nodes.item(i).getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) return true;
        }
        return false;
    }