mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Generate XML-compatible tags and boolean attributes
This commit is contained in:
@@ -208,12 +208,12 @@ ReactDOMComponent.Mixin = {
|
||||
mountComponent: function(rootID, transaction, context) {
|
||||
this._rootNodeID = rootID;
|
||||
assertValidProps(this, this._currentElement.props);
|
||||
var closeTag = omittedCloseTags[this._tag] ? '' : '</' + this._tag + '>';
|
||||
return (
|
||||
this._createOpenTagMarkupAndPutListeners(transaction) +
|
||||
this._createContentMarkup(transaction, context) +
|
||||
closeTag
|
||||
);
|
||||
var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction);
|
||||
var tagContent = this._createContentMarkup(transaction, context);
|
||||
if(!tagContent && omittedCloseTags[this._tag]){
|
||||
return tagOpen + '/>';
|
||||
}
|
||||
return tagOpen + '>' + tagContent + '</' + this._tag + '>';
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -260,11 +260,11 @@ ReactDOMComponent.Mixin = {
|
||||
// For static pages, no need to put React ID and checksum. Saves lots of
|
||||
// bytes.
|
||||
if (transaction.renderToStaticMarkup) {
|
||||
return ret + '>';
|
||||
return ret;
|
||||
}
|
||||
|
||||
var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
|
||||
return ret + ' ' + markupForID + '>';
|
||||
return ret + ' ' + markupForID;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,7 +96,7 @@ var DOMPropertyOperations = {
|
||||
var attributeName = DOMProperty.getAttributeName[name];
|
||||
if (DOMProperty.hasBooleanValue[name] ||
|
||||
(DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
|
||||
return attributeName;
|
||||
return attributeName + '=""';
|
||||
}
|
||||
return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
||||
} else if (DOMProperty.isCustomAttribute(name)) {
|
||||
|
||||
Reference in New Issue
Block a user