Compiles a self-closing tag, dealing with elements that may or not be
self-closing

@param {String} tag - JSX component name
@param {Object} props - Element properties
186039
function compileSelfClosingTag(tag, props) {
    const compiledProps = compileProps(props);

    return contains(tag, ['br', 'hr', 'img'])
        ? `<${tag}${compiledProps} />`
        : `<${tag}${compiledProps}></${tag}>`;
}
130279
function validatePropTypes(element) {
  var componentClass = element.type;
  if (typeof componentClass !== 'function') {
    return;
  }
  var name = componentClass.displayName || componentClass.name;
  var propTypes = componentClass.propTypes;

  if (propTypes) {
    currentlyValidatingElement = element;
    checkPropTypes$1(propTypes, element.props, 'prop', name, getStackAddendum$1);
    currentlyValidatingElement = null;
  }
  if (typeof componentClass.getDefaultProps === 'function') {
    warning$3(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
  }
}
174534
function(el, componentTagData) {
			// Save arguments so if this component gets re-inserted,
			// we can setup again.
			this._initialArgs = [el,componentTagData];

			var component = this;

			var options = {
				helpers: {},
				tags: {}
			};

			// #### Clean up arguments

			// If componentTagData isn’t defined, check for el and use it if it’s defined;
			// otherwise, an empty object is needed for componentTagData.
			if (componentTagData === undefined) {
				if (el === undefined) {
					componentTagData = {};
				} else {
					componentTagData = el;
					el = undefined;
				}
			}

			// Create an element if it doesn’t exist and make it available outside of this
			if (el === undefined) {
				el = DOCUMENT().createElement(this.tag);
				el[createdByCanComponentSymbol] = true;
			}
			this.element = el;

			if(componentTagData.initializeBindings === false && !this._skippedSetup) {
				// Temporary, will be overridden.
				this._skippedSetup = this._torndown = true;
				this.viewModel = Object.create(null);
				return;
			}

			var componentContent = componentTagData.content;
			if (componentContent !== undefined) {
				// Check if it’s already a renderer function or
				// a string that needs to be parsed by stache
				if (typeof componentContent === "function") {
					componentTagData.subtemplate = componentContent;
				} else if (typeof componentContent === "string") {
					componentTagData.subtemplate = stache(componentContent);
				}
			}

			var componentScope = componentTagData.scope;
			if (componentScope !== undefined && componentScope instanceof Scope === false) {
				componentTagData.scope = new Scope(componentScope);
			}

			// Hook up any templates with which the component was instantiated
			var componentTemplates = componentTagData.templates;
			if (componentTemplates !== undefined) {
				canReflect.eachKey(componentTemplates, function(template, name) {
					// Check if it’s a string that needs to be parsed by stache
					if (typeof template === "string") {
						var debugName = name + " template";
						componentTemplates[name] = stache(debugName, template);
					}
				});
			}

			// #### Setup ViewModel
			var viewModel;
			var initialViewModelData = {};

			var preventDataBindings = domData.get(el, "preventDataBindings");

			var teardownBindings;
			if (preventDataBindings) {
				viewModel = el[viewModelSymbol];
			} else {
				// Set up the bindings
				var setupFn;
				if (componentTagData.setupBindings) {
					setupFn = function(el, componentTagData, callback, initialViewModelData){
						return componentTagData.setupBindings(el, callback, initialViewModelData);
					};
				} else if (componentTagData.viewModel) {
					// Component is being instantiated with a viewModel
					setupFn = getSetupFunctionForComponentVM(componentTagData.viewModel);
				} else {
					setupFn = stacheBindings.behaviors.viewModel;
				}
				teardownBindings = setupFn(el, componentTagData, function(initialViewModelData) {

					var ViewModel = component.constructor.ViewModel,
						viewModelHandler = component.constructor.viewModelHandler,
						viewModelInstance = component.constructor.viewModelInstance;

					if(viewModelHandler) {
						var scopeResult = viewModelHandler.call(component, initialViewModelData, componentTagData.scope, el);
						if (canReflect.isObservableLike(scopeResult) && canReflect.isMapLike(scopeResult) ) {
							// If the function returns a can.Map, use that as the viewModel
							viewModelInstance = scopeResult;
						} else if (canReflect.isObservableLike(scopeResult.prototype) && canReflect.isMapLike(scopeResult.prototype)) {
							// If `scopeResult` is of a `can.Map` type, use it to wrap the `initialViewModelData`
							ViewModel = scopeResult;
						} else {
							// Otherwise extend `SimpleMap` with the `scopeResult` and initialize it with the `initialViewModelData`
							ViewModel = SimpleMap.extend(scopeResult);
						}
					}

					if(ViewModel) {
						viewModelInstance = new ViewModel(initialViewModelData);
					}
					viewModel = viewModelInstance;
					return viewModelInstance;
				}, initialViewModelData);
			}

			// Set `viewModel` to `this.viewModel` and set it to the element's `data` object as a `viewModel` property
			this.viewModel = viewModel;
			el[viewModelSymbol] = viewModel;
			el.viewModel = viewModel;
			domData.set(el, "preventDataBindings", true);

			// an array of teardown stuff that should happen when the element is removed
			var teardownFunctions = [];
			var callTeardownFunctions = function() {
					for (var i = 0, len = teardownFunctions.length; i < len; i++) {
						teardownFunctions[i]();
					}
				};

			// #### Helpers
			// TODO: remove in next release
			// Setup helpers to callback with `this` as the component
			if(this.helpers !== undefined) {
				canReflect.eachKey(this.helpers, function(val, prop) {
					if (typeof val === "function") {
						options.helpers[prop] = val.bind(viewModel);
					}
				});
			}


			// #### `events` control
			// TODO: remove in next release
			// Create a control to listen to events
			if(this.constructor.Control) {
				this._control = new this.constructor.Control(el, {
					// Pass the viewModel to the control so we can listen to it's changes from the controller.
					scope: this.viewModel,
					viewModel: this.viewModel,
					destroy: callTeardownFunctions
				});
			} else {
				var removalDisposal = domMutate.onNodeRemoval(el, function () {
					var doc = el.ownerDocument;
					var rootNode = doc.contains ? doc : doc.documentElement;
					if (!rootNode || !rootNode.contains(el)) {
						if(removalDisposal) {
							nodeRemoved = true;
							removalDisposal();
							callTeardownFunctions();
							removalDisposal = null;
							callTeardownFunctions = null;
						}
					}
				});
			}

			// #### Rendering

			var leakScope = {
				toLightContent: this.leakScope === true,
				intoShadowContent: this.leakScope === true
			};

			var hasShadowView = !!(this.constructor.view);
			var shadowFragment;

			// Get what we should render between the component tags
			// and the data for it.
			var betweenTagsView;
			var betweenTagsTagData;
			if( hasShadowView ) {
				var shadowTagData;
				if (leakScope.intoShadowContent) {
					// Give access to the component's data and the VM
					shadowTagData = {
						scope: componentTagData.scope.add(this.viewModel, { viewModel: true }),
						options: options
					};

				} else { // lexical
					// only give access to the VM
					shadowTagData = {
						scope: new Scope(this.viewModel, null, { viewModel: true }),
						options: options
					};
				}

				// Add a hookup for each <can-slot>
				options.tags['can-slot'] = makeReplacementTagCallback('can-slot', componentTagData, shadowTagData, leakScope, function(el) {
					var templates = componentTagData.templates;
					if (templates) {// This is undefined if the component is <self-closing/>
						return templates[el.getAttribute("name")];
					}
				});

				// Add a hookup for <content>
				options.tags.content = makeReplacementTagCallback('content',  componentTagData, shadowTagData, leakScope, function() {
					return componentTagData.subtemplate;
				});

				betweenTagsView = this.constructor.view;
				betweenTagsTagData = shadowTagData;
			}
			else {
				// No shadow template.
				// Render light template with viewModel on top
				var lightTemplateTagData = {
					scope: componentTagData.scope.add(this.viewModel, {
						viewModel: true
					}),
					options: options
				};
				betweenTagsTagData = lightTemplateTagData;
				betweenTagsView = componentTagData.subtemplate || el.ownerDocument.createDocumentFragment.bind(el.ownerDocument);
			}
			var viewModelDisconnectedCallback,
				insertionDisposal,
				componentInPage,
				nodeRemoved;

			// Keep a nodeList so we can kill any directly nested nodeLists within this component
			var nodeList = nodeLists.register([], function() {
				if(removalDisposal && !nodeRemoved) {
					removalDisposal();
					callTeardownFunctions();
					removalDisposal = null;
					callTeardownFunctions = null;
				}
				component._torndown = true;
				domEvents.dispatch(el, "beforeremove", false);
				if(teardownBindings) {
					teardownBindings();
				}
				if(viewModelDisconnectedCallback) {
					viewModelDisconnectedCallback(el);
				} else if(typeof viewModel.stopListening === "function"){
					viewModel.stopListening();
				}
				if(insertionDisposal) {
					insertionDisposal();
					insertionDisposal = null;
				}
			}, componentTagData.parentNodeList || true, false);
			nodeList.expression = "<" + this.tag + ">";
			teardownFunctions.push(function() {
				nodeLists.unregister(nodeList);
			});
			this.nodeList = nodeList;

			shadowFragment = betweenTagsView(betweenTagsTagData.scope, betweenTagsTagData.options, nodeList);

			// TODO: afterRender

			// Append the resulting document fragment to the element
			domMutateNode.appendChild.call(el, shadowFragment);

			// update the nodeList with the new children so the mapping gets applied
			nodeLists.update(nodeList, getChildNodes(el));

			// Call connectedCallback
			if(viewModel && viewModel.connectedCallback) {
				var body = DOCUMENT().body;
				componentInPage = body && body.contains(el);

				if(componentInPage) {
					viewModelDisconnectedCallback = viewModel.connectedCallback(el);
				} else {
					insertionDisposal = domMutate.onNodeInsertion(el, function () {
						insertionDisposal();
						insertionDisposal = null;
						viewModelDisconnectedCallback = viewModel.connectedCallback(el);
					});
				}

			}
			component._torndown = false;
		}
122858
function checkTagName(node, output) {
  var result = output.result
  var deps = output.deps
  var log = output.log

  var tagName = node.tagName
  var childNodes = node.childNodes || []
  var location = node.__location || {}

  // alias
  if (TAG_NAME_ALIAS_MAP[tagName]) {
    if (tagName !== 'img') { // FIXME: `parse5` autofixes image to img silently
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'NOTE: tag name `' + tagName + '` is autofixed to `' + TAG_NAME_ALIAS_MAP[tagName] + '`'
      })
    }
    tagName = TAG_NAME_ALIAS_MAP[tagName]
  }

  if (tagName === 'component') {
    var indexOfIs = -1
    if (node.attrs) {
      node.attrs.forEach(function (attr, index) {
        if (attr.name === 'is') {
          indexOfIs = index
          result.type = tagName = exp(attr.value)
        }
      })
    }
    if (indexOfIs > -1) {
      node.attrs.splice(indexOfIs, 1) // delete `is`
    }
    else {
      result.type = tagName = 'container'
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'WARNING: tag `component` should have an `is` attribute, otherwise it will be regarded as a `container`'
      })
    }
  }
  else {
    result.type = tagName
  }

  // deps
  if (deps.indexOf(tagName) < 0 && typeof tagName === 'string') { // FIXME: improve `require` to bundle dynamic binding components
    deps.push(tagName)
  }

  // parent (no any rules yet)

  // child (noChild, textContent)
  if (NO_CHILD_TAG_NAME_LIST.indexOf(tagName) >= 0) {
    if (childNodes.length > 0) {
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'ERROR: tag `' + tagName + '` should not have children'
      })
    }
  }
  if (TEXT_CONTENT_TAG_NAME_LIST.indexOf(tagName) >= 0) {
    if (childNodes.length > 1 || (childNodes[0] && childNodes[0].nodeName !== '#text')) {
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'ERROR: tag name `' + tagName + '` should just have one text node only'
      })
    }
  }

  // default attr
  if (TAG_DEFAULT_ATTR_MAP[tagName]) {
    Object.keys(TAG_DEFAULT_ATTR_MAP[tagName]).forEach(function (attr) {
      if (attr !== 'append') {
        result.attr = result.attr || {}
        result.attr[attr] = TAG_DEFAULT_ATTR_MAP[tagName][attr]
      }
      else {
        result[attr] = TAG_DEFAULT_ATTR_MAP[tagName][attr]
      }
    })
  }
}
1005612
static CloseElementTag asEngineCloseElementTag(final ICloseElementTag closeElementTag) {

        if (closeElementTag instanceof CloseElementTag) {
            return (CloseElementTag) closeElementTag;
        }

        return new CloseElementTag(
                closeElementTag.getTemplateMode(), closeElementTag.getElementDefinition(), closeElementTag.getElementCompleteName(),
                null, closeElementTag.isSynthetic(), closeElementTag.isUnmatched(),
                closeElementTag.getTemplateName(), closeElementTag.getLine(), closeElementTag.getCol());

    }
76451
function h(node, tagName, props, children) {
    if (
      (children === undefined || children === null) &&
      typeof props === 'object' &&
      'length' in props
    ) {
      children = props
      props = {}
    }

    return augment(node, {
      type: 'element',
      tagName: tagName,
      properties: props || {},
      children: children || []
    })
  }
1198472
function TagList(props: Props): React.Node {
  const { children, className } = props;
  const classes = cn("tags", className);
  return <div className={classes}>{children}</div>;
}
706432
public static String constructHadoopTags(Props props, String[] keys) {
    String[] keysAndValues = new String[keys.length];
    for (int i = 0; i < keys.length; i++) {
      if (props.containsKey(keys[i])) {
        keysAndValues[i] = keys[i] + ":" + props.get(keys[i]);
      }
    }
    Joiner joiner = Joiner.on(',').skipNulls();
    return joiner.join(keysAndValues);
  }
276700
function (root, tagName) {
    return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
      return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
    });
  }
663252
function renderToString(element) {
  !React.isValidElement(element) ?  false ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
  return renderToStringImpl(element, false);
}
599181
function element(node, options = {}) {
  const { namespace } = options;
  const { tagName, properties, children = [] } = node;
  const el = typeof namespace !== 'undefined'
    ? document.createElementNS(namespace, tagName)
    : document.createElement(tagName);

  // Add HTML attributes
  const props = Object.keys(properties);
  const { length } = props;
  for (let i = 0; i < length; i += 1) {
    const key = props[i];
    const {
      attribute,
      property,
      mustUseAttribute,
      mustUseProperty,
      boolean,
      booleanish,
      overloadedBoolean,
      // number,
      // defined,
      commaSeparated,
      spaceSeparated,
      // commaOrSpaceSeparated,
    } = info.find(info.html, key) || {
      attribute: key,
      property: key,
    };

    let value = properties[key];
    if (Array.isArray(value)) {
      if (commaSeparated) {
        value = value.join(', ');
      } else if (spaceSeparated) {
        value = value.join(' ');
      } else {
        value = value.join(' ');
      }
    }

    try {
      if (mustUseProperty) {
        el[property] = value;
      }
      if (boolean || (overloadedBoolean && typeof value === 'boolean')) {
        if (value) {
          el.setAttribute(attribute, '');
        } else {
          el.removeAttribute(attribute);
        }
      } else if (booleanish) {
        el.setAttribute(attribute, value);
      } else if (value === true) {
        el.setAttribute(attribute, '');
      } else if (value || value === 0 || value === '') {
        el.setAttribute(attribute, value);
      }
    } catch (e) {
      if (!mustUseAttribute && property) {
        el[property] = value;
      }
      // Otherwise silently ignore
    }
  }

  // Transform children
  const { length: childrenLength } = children;
  for (let i = 0; i < childrenLength; i += 1) {
    const childEl = transform(children[i], options);
    if (childEl) {
      el.appendChild(childEl);
    }
  }

  return el;
}
480349
function shouldRecycleElement(oldElement, props, tag) {
  return (
    !isTextNode(oldElement) &&
    oldElement.id === "" &&
    !nodeTypeDiffers(oldElement, tag)
  );
}
201425
function renderToStaticMarkup(element) {
  !React.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : _prodInvariant('47') : void 0;
  return renderToStringImpl(element, true);
}
337917
private void renderTag(Tag tag, StringBuilder buffer) {
        buffer.append(tag.name()).append(' ');
        // Special handling for @param <T> tags
        // See http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@param
        if ((tag instanceof ParamTag) && ((ParamTag) tag).isTypeParameter()) {
            ParamTag paramTag = (ParamTag) tag;
            buffer.append("<" + paramTag.parameterName() + ">");
            String text = paramTag.parameterComment();
            if (text.length() > 0) {
                buffer.append(' ').append(render(text, true));
            }
            return;
        }
        buffer.append(render(tag.text(), true));
    }
32907
function Tag(tagName, config, children) {
  this.tagName = tagName || 'div';
  config = config || {};
  this.children = children || [];
  this.props = config.props;
  this.attrs = config.attrs;
  this.attrsNS = config.attrsNS;
  this.events = config.events;
  this.hooks = config.hooks;
  this.data = config.data;
  this.params = config.params;
  this.element = undefined;
  this.parent = undefined;

  this.key = config.key != null ? config.key : undefined;

  this.namespace = config.attrs && config.attrs.xmlns || null;
  this.is = config.attrs && config.attrs.is || null;
}
823272
function Tag(page, startPosition, endPosition, attributes) {
        var self = this;
        self.childNodes = [];
        self.firstChild = null;
        self.lastChild = null;
        self.attributes = attributes || [];
        self.nodeType = 1;
        if (typeof page === 'string') {
            createTag.apply(null, [self].concat(util.makeArray(arguments)));
        } else {
            Tag.superclass.constructor.apply(self, arguments);
            attributes = self.attributes;    // first attribute is actually nodeName
            // first attribute is actually nodeName
            if (attributes[0]) {
                self.nodeName = attributes[0].name.toLowerCase();    // end tag (</div>) is a tag too in lexer , but not exist in parsed dom tree
                // end tag (</div>) is a tag too in lexer , but not exist in parsed dom tree
                self.tagName = self.nodeName.replace(/\//, '');
                self._updateSelfClosed();
                attributes.splice(0, 1);
            }
            var lastAttr = attributes[attributes.length - 1], lastSlash = !!(lastAttr && /\/$/.test(lastAttr.name));
            if (lastSlash) {
                attributes.length = attributes.length - 1;
            }    // self-closing flag
            // self-closing flag
            self.isSelfClosed = self.isSelfClosed || lastSlash;    // whether has been closed by its end tag
                                                                   // !TODO how to set closed position correctly
            // whether has been closed by its end tag
            // !TODO how to set closed position correctly
            self.closed = self.isSelfClosed;
        }
        self.closedStartPosition = -1;
        self.closedEndPosition = -1;
    }
356865
function (tag) {
                var
                    len = this._openedTags.length;
                if (len && this._openedTags[len - 1] === tag) {
                    this._openedTags.pop();
                    this._output("</" + tag + ">");
                } else {
                    this._openTag(tag);
                }
            }