/*
Determine whether any of the matched elements are assigned the given class.
@param {HTMLElement} elm
@param {String} name
498742
function hasClass(elm, name) {
        var re = classRE(name);
        return elm.className && elm.className.match(re);
    }
1216010
function addClass(elm, name) {
        if (!name) return this
        var cls = className(elm),
            names;
        if (langx.isString(name)) {
            names = name.split(/\s+/g);
        } else {
            names = name;
        }
        names.forEach(function(klass) {
            var re = classRE(klass);
            if (!cls.match(re)) {
                cls += (cls ? " " : "") + klass;
            }
        });

        className(elm, cls);

        return this;
    }
722633
private static Element findElement(Document document, String name) {
        Element result = null;

        List<Element> elementList = getElements(document);

        for (Element element : elementList) {
            if (element.getAttribute("id").equalsIgnoreCase(name) == true) {
                result = element;
                break;
            }
        }

        return result;
    }
91571
function (node, name,filter) {
        if(filter && utils.isString(filter)){
           var className = filter;
           filter =  function(node){return domUtils.hasClass(node,className)}
        }
        name = utils.trim(name).replace(/[ ]{2,}/g,' ').split(' ');
        var arr = [];
        for(var n = 0,ni;ni=name[n++];){
            var list = node.getElementsByTagName(ni);
            for (var i = 0, ci; ci = list[i++];) {
                if(!filter || filter(ci))
                    arr.push(ci);
            }
        }

        return arr;
    }
1315807
function(elm) {
			var index = -1;
			var parts = [];
			function hasid(elm) {
				if (elm.id) {
					try {
						gui.DOMPlugin.q(elm.parentNode, elm.id);
						return true;
					} catch (malformedexception) {}
				}
				return false;
			}
			while (elm && elm.nodeType === Node.ELEMENT_NODE) {
				if (hasid(elm)) {
					parts.push("#" + elm.id);
					elm = null;
				} else {
					if (elm.localName === "body") {
						parts.push("body");
						elm = null;
					} else {
						index = gui.DOMPlugin.ordinal(elm) + 1;
						parts.push(">" + elm.localName + ":nth-child(" + index + ")");
						elm = elm.parentNode;
					}
				}
			}
			return parts.reverse().join("");
		}
1048175
function(className)
	{
		var el = this.__obj;
		
		return el instanceof Element && className
			? el.classList.contains(className)
			: false;
	}
236513
function(name) {
        if (!this.has(name)) return false;

        var eClass = this.eClass;
        if (!eClass) return false;

        var value = this.get(name);
        if (value instanceof EList) {
            return value.size() > 0;
        } else {
            return value !== null && typeof value !== 'undefined';
        }
    }
612941
function checkComponentDefined (el, name) {
  // Check if element contains the component.
  if (el.components[name] && el.components[name].attrValue) { return true; }

  return isComponentMixedIn(name, el.mixinEls);
}
616115
function(name) {
            if (typeof name === 'undefined') return this._element;
            var e = this._element.querySelector("[name='" + name + "']");
            if (!e) {
                throw new Error(
                    "[WTag.get] Can't find child [name=\""
                        + name + "\"] in element \"" + this._id + "\"!"
                );
            }
            return e;
        }
452649
function (el, className) {
        if (className && isElement(el)) {
            return el.classList.contains(className)
        }

        return false
    }
659647
public function hasElement($name)
    {
        foreach($this->elements as $element){
            if($element->getName() == $name) {
                return true;
            }
        }

        return false;
    }
1297453
function matches(elem, selector) {
  // Vendor-specific implementations of `Element.prototype.matches()`.
  var proto = window.Element.prototype;
  var nativeMatches = proto.matches ||
      proto.mozMatchesSelector ||
      proto.msMatchesSelector ||
      proto.oMatchesSelector ||
      proto.webkitMatchesSelector;

  if (!elem || elem.nodeType !== 1) {
    return false;
  }

  var parentElem = elem.parentNode;

  // use native 'matches'
  if (nativeMatches) {
    return nativeMatches.call(elem, selector);
  }

  // native support for `matches` is missing and a fallback is required
  var nodes = parentElem.querySelectorAll(selector);
  var len = nodes.length;

  for (var i = 0; i < len; i++) {
    if (nodes[i] === elem) {
      return true;
    }
  }

  return false;
}
686363
function( elem, classNames ) {
			if (elem.nodeType == 1)
				elem.className = classNames !== undefined ?
					jQuery.grep(elem.className.split(/\s+/), function(className){
						return !jQuery.className.has( classNames, className );
					}).join(" ") :
					"";
		}
1295575
def matches(self, tag, id, classes):
        
        element = self.elements[0]
        unmatched_ids = [name[1:] for name in element.names if name.startswith('#')]
        unmatched_classes = [name[1:] for name in element.names if name.startswith('.')]
        unmatched_tags = [name for name in element.names if name is not '*' and not name.startswith('#') and not name.startswith('.')]
        
        if tag and tag in unmatched_tags:
            unmatched_tags.remove(tag)

        if id and id in unmatched_ids:
            unmatched_ids.remove(id)

        for class_ in classes:
            if class_ in unmatched_classes:
                unmatched_classes.remove(class_)
        
        if unmatched_tags or unmatched_ids or unmatched_classes:
            return False

        else:
            return True
1045956
function createElementWithClassName(type, className) {
  var elm = document.createElement(type);
  elm.className = className;
  return elm;
}
519493
function(element, className) {
    invariant(
      !/\s/.test(className),
      'CSS.hasClass takes only a single class name.'
    );
    if (element.classList) {
      return !!className && element.classList.contains(className);
    }
    return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
  }
1246434
function getAttribute(element, name) {
  assertType(element, Node, false, 'Invalid element specified');

  if (!element.getAttribute) return null;

  let value = element.getAttribute(name);
  if (value === '') return true;
  if (value === undefined || value === null) return null;
  try {
    return JSON.parse(value);
  }
  catch (err) {
    return value;
  }
}