From 6af987c524d3801efd2a330f4ab1265b81f7cff3 Mon Sep 17 00:00:00 2001 From: syranide Date: Tue, 3 Feb 2015 16:46:32 +0100 Subject: [PATCH] Drop processAttributeNameAndPrefix and invalid attribute name escaping --- src/browser/ui/dom/DOMPropertyOperations.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/browser/ui/dom/DOMPropertyOperations.js b/src/browser/ui/dom/DOMPropertyOperations.js index fda4544981da4..f94703ea50282 100644 --- a/src/browser/ui/dom/DOMPropertyOperations.js +++ b/src/browser/ui/dom/DOMPropertyOperations.js @@ -16,7 +16,6 @@ var DOMProperty = require('DOMProperty'); var escapeTextContentForBrowser = require('escapeTextContentForBrowser'); var quoteAttributeValueForBrowser = require('quoteAttributeValueForBrowser'); -var memoizeStringOnly = require('memoizeStringOnly'); var warning = require('warning'); function shouldIgnoreValue(name, value) { @@ -27,10 +26,6 @@ function shouldIgnoreValue(name, value) { (DOMProperty.hasOverloadedBooleanValue[name] && value === false); } -var processAttributeNameAndPrefix = memoizeStringOnly(function(name) { - return escapeTextContentForBrowser(name) + '='; -}); - if (__DEV__) { var reactProps = { children: true, @@ -82,7 +77,7 @@ var DOMPropertyOperations = { * @return {string} Markup string. */ createMarkupForID: function(id) { - return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) + + return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); }, @@ -102,16 +97,14 @@ var DOMPropertyOperations = { var attributeName = DOMProperty.getAttributeName[name]; if (DOMProperty.hasBooleanValue[name] || (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) { - return escapeTextContentForBrowser(attributeName); + return attributeName; } - return processAttributeNameAndPrefix(attributeName) + - quoteAttributeValueForBrowser(value); + return attributeName + '=' + quoteAttributeValueForBrowser(value); } else if (DOMProperty.isCustomAttribute(name)) { if (value == null) { return ''; } - return processAttributeNameAndPrefix(name) + - quoteAttributeValueForBrowser(value); + return name + '=' + quoteAttributeValueForBrowser(value); } else if (__DEV__) { warnUnknownProperty(name); }