Holds properties to traverse for certain HTML tags
504184
function DumperGetArgs(a,index) {
	var args = new Array();
	// This is kind of ugly, but I don't want to use js1.2 functions, just in case...
	for (var i=index; i<a.length; i++) {
		args[args.length] = a[i];
	}
	return args;
}
868434
@Override @DefinedBy(Api.COMPILER_TREE) @SuppressWarnings("fallthrough")
    public Void visitAttribute(AttributeTree tree, Void ignore) {
        HtmlTag currTag = tagStack.peek().tag;
        if (currTag != null) {
            Name name = tree.getName();
            HtmlTag.Attr attr = currTag.getAttr(name);
            if (attr != null) {
                if (env.htmlVersion == HtmlVersion.HTML4 && attr.name().contains("-")) {
                    env.messages.error(HTML, tree, "dc.attr.not.supported.html4", name);
                }
                boolean first = tagStack.peek().attrs.add(attr);
                if (!first)
                    env.messages.error(HTML, tree, "dc.attr.repeated", name);
            }
            // for now, doclint allows all attribute names beginning with "on" as event handler names,
            // without checking the validity or applicability of the name
            if (!name.toString().startsWith("on")) {
                AttrKind k = currTag.getAttrKind(name);
                switch (env.htmlVersion) {
                    case HTML4:
                        validateHtml4Attrs(tree, name, k);
                        break;

                    case HTML5:
                        validateHtml5Attrs(tree, name, k);
                        break;
                }
            }

            if (attr != null) {
                switch (attr) {
                    case NAME:
                        if (currTag != HtmlTag.A) {
                            break;
                        }
                        // fallthrough
                    case ID:
                        String value = getAttrValue(tree);
                        if (value == null) {
                            env.messages.error(HTML, tree, "dc.anchor.value.missing");
                        } else {
                            if (!validName.matcher(value).matches()) {
                                env.messages.error(HTML, tree, "dc.invalid.anchor", value);
                            }
                            if (!checkAnchor(value)) {
                                env.messages.error(HTML, tree, "dc.anchor.already.defined", value);
                            }
                        }
                        break;

                    case HREF:
                        if (currTag == HtmlTag.A) {
                            String v = getAttrValue(tree);
                            if (v == null || v.isEmpty()) {
                                env.messages.error(HTML, tree, "dc.attr.lacks.value");
                            } else {
                                Matcher m = docRoot.matcher(v);
                                if (m.matches()) {
                                    String rest = m.group(2);
                                    if (!rest.isEmpty())
                                        checkURI(tree, rest);
                                } else {
                                    checkURI(tree, v);
                                }
                            }
                        }
                        break;

                    case VALUE:
                        if (currTag == HtmlTag.LI) {
                            String v = getAttrValue(tree);
                            if (v == null || v.isEmpty()) {
                                env.messages.error(HTML, tree, "dc.attr.lacks.value");
                            } else if (!validNumber.matcher(v).matches()) {
                                env.messages.error(HTML, tree, "dc.attr.not.number");
                            }
                        }
                        break;

                    case BORDER:
                        if (currTag == HtmlTag.TABLE) {
                            String v = getAttrValue(tree);
                            try {
                                if (env.htmlVersion == HtmlVersion.HTML5
                                        && (v == null || (!v.isEmpty() && Integer.parseInt(v) != 1))) {
                                    env.messages.error(HTML, tree, "dc.attr.table.border.html5", attr);
                                }
                            } catch (NumberFormatException ex) {
                                env.messages.error(HTML, tree, "dc.attr.table.border.html5", attr);
                            }
                        }
                        break;
                }
            }
        }

        // TODO: basic check on value

        return super.visitAttribute(tree, ignore);
    }
126229
private function loadProperties(&$tags, \DOMXPath $xpath, \DOMNode $context): array
    {
        $result = [];

        /** @var \DOMElement $node */
        foreach ($xpath->query('x:*', $context) as $node) {
            if ('property' === $node->tagName) {
                $value = $this->loadProperty($xpath, $node, $tags);
                $result[$value['name']] = $value;
            } elseif ('block' === $node->tagName) {
                $value = $this->loadBlock($xpath, $node, $tags);
                $result[$value['name']] = $value;
            } elseif ('section' === $node->tagName) {
                $value = $this->loadSection($xpath, $node, $tags);
                $result[$value['name']] = $value;
            }
        }

        return $result;
    }
1182803
function baseGetTag(value) {
    if (value == null) {
      return value === undefined ? undefinedTag : nullTag;
    }
    return symToStringTag && symToStringTag in Object(value)
      ? getRawTag(value)
      : objectToString(value);
  }
1046907
function( data, tag, searchData ) {

			var letter, l, depth = 2,
				current = searchData;

			for ( l = 0; l < depth; l++ ) {
				letter = tag.substring(l, l + 1);
				if (!current[letter] ) {
					current[letter] = {};
					current[letter].list = [];
				}
				if ( indexOf(current[letter].list, data) == -1 ) {
					current[letter].list.push(data);
				}
				current = current[letter];
			}
		}
312061
function parseTag(raw) {
	var cached = tagCache[raw];

	if (cached == null) {
		var tag, id, cls, attr;

		tagCache[raw] = cached = {
			tag:	(tag	= raw.match( /^[-\w]+/))		?	tag[0]						: "div",
			id:		(id		= raw.match( /#([-\w]+)/))		? 	id[1]						: null,
			class:	(cls	= raw.match(/\.([-\w.]+)/))		?	cls[1].replace(/\./g, " ")	: null,
			attrs:	null,
		};

		while (attr = RE_ATTRS.exec(raw)) {
			if (cached.attrs == null)
				{ cached.attrs = {}; }
			cached.attrs[attr[1]] = attr[2] || "";
		}
	}

	return cached;
}
1217202
def getElementsByAttr(self, attrName, attrValue):
        '''
            
        '''
        elements = []
        for child in self.children:
            if child.getAttribute(attrName) == attrValue:
                elements.append(child)
            elements += child.getElementsByAttr(attrName, attrValue)
        return TagCollection(elements)
819852
def _get_elements_property(parent_to_parse, element_path, prop_name):
    

    parent_element = get_element(parent_to_parse)

    if parent_element is None:
        return []

    if element_path and not element_exists(parent_element, element_path):
        return []

    if not element_path:
        texts = getattr(parent_element, prop_name)
        texts = texts.strip() if isinstance(texts, string_types) else texts
        texts = [texts] if texts else []
    else:
        texts = [t for t in (
            prop.strip() if isinstance(prop, string_types) else prop
            for prop in (getattr(node, prop_name) for node in parent_element.findall(element_path)) if prop
        ) if t]

    return texts
351661
function parseTags(tags) {
    if (tags.length > 0 && util.isArray(tags[0])) {
        tags = tags[0];
    }

    return tags;
}
936278
def get_properties(self, node):
        
        ret = {}
        # Try all the rules one by one
        for rule in self.rules:
            if rule.selector(node):
                ret.update(rule.properties)
        # Also search for direct 'style' arguments in the html doc
        for style_node in node.findParents(attrs={'style': True}):
            style = style_node.get('style')
            properties = self.parse_declarations(style)
            ret.update(properties)
        return ret
282455
function extractDomProperties(domNode, regex, removeDomAttributes = false) {


	if(regex && classof(regex) !== 'RegExp'){
		throw Error('Second argument is passed but it must be a Regular-Expression');
	}

	let domViewAttributes = {};
	let toBeRemovedAttributes = [];

	for(let key in domNode.attributes) {
		if(!domNode.attributes.hasOwnProperty(key)){
			continue;
		}

		let node = domNode.attributes[key];
		if(regex){
			let matched = regex.exec(node.name);
			if(matched !== null) {
				let [ ,name ] = matched;
				domViewAttributes[name] = node.value;
				removeDomAttributes ? toBeRemovedAttributes.push(node.name) : null;
			}
		}
		else if(!regex) {
			domViewAttributes[node.name] = node.value;
		}

	}

	if(removeDomAttributes){
		for(let attribute of toBeRemovedAttributes){
			domNode.removeAttribute(attribute);
		}
	}

	return domViewAttributes;

}
1255067
function tag(name, attrs, close, content) {
  var end = close ? '/>' : '>';
  var pairs = [];
  var tag;

  for (var key in attrs) {
    if (Object.prototype.hasOwnProperty.call(attrs, key)) {
      pairs.push(key + '="' + escape(attrs[key]) + '"');
    }
  }

  tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
  if (content) {
    tag += content + '</' + name + end;
  }
  return tag;
}
1251539
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return symToStringTag && symToStringTag in Object(value) ? (0, _getRawTag2.default)(value) : (0, _objectToString2.default)(value);
}
465981
function (name, value, tag/*, ...*/) {
    var args = SLICE.call(arguments, 2);
    args[0] = value;
    return this.visit.apply(this, args);
  }
1153634
def validateTagAttributes(self, attribs, element):
		""""""
		out = {}
		if element not in _whitelist:
			return out
		whitelist = _whitelist[element]
		for attribute in attribs:
			value = attribs[attribute]
			if attribute not in whitelist:
				continue
			# Strip javascript "expression" from stylesheets.
			# http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp
			if attribute == u'style':
				value = self.checkCss(value)
				if value == False:
					continue
			elif attribute == u'id':
				value = self.escapeId(value)
			# If this attribute was previously set, override it.
			# Output should only have one attribute of each name.
			out[attribute] = value
		return out
262772
function(ast, offset) {
			var found = null;
			var dom = ast;
			var missingTagClose = false;
			if (!Array.isArray(ast) && ast.children){
				dom = ast.children;
			}
			 Visitor.visit(dom, {
	            visitNode: function(node) {
					if(node.range[0] <= offset) {
						found = node;
					} else {
					    return Visitor.BREAK;
					}      
	            },
	            endVisitNode: function(node) {
	            	if(found && !missingTagClose && offset >= found.range[1] && offset > node.range[0]) {
	            		found = node;
	            		// If at the boundary of a tag range and there is a missing end tag, return the innermost tag  <a><b></a>
	            		if (offset === found.range[1] && found.endrange && found.openrange && found.endrange[1] === found.openrange[1]){
	            			missingTagClose = true;
	            		}
	            	}
	            }
	        });
	        return found;
		}
415273
function () {
		var str, i, len;

		// TODO void tags
		str = '' +
			'<' + this.descriptor.e;

		len = this.attributes.length;
		for ( i=0; i<len; i+=1 ) {
			str += ' ' + this.attributes[i].toString();
		}

		str += '>';

		if ( this.html ) {
			str += this.html;
		} else if ( this.fragment ) {
			str += this.fragment.toString();
		}

		str += '</' + this.descriptor.e + '>';

		return str;
	}