From 77ae237be945b6e202016fb420e0bc246e6eed5b Mon Sep 17 00:00:00 2001 From: Matthew Dapena-Tretter Date: Thu, 3 Apr 2014 21:21:38 -0400 Subject: [PATCH] Rename CAN_BE_MINIMIZED to HAS_BOOLEANISH_VALUE --- src/browser/ui/dom/DOMProperty.js | 12 ++++++------ src/browser/ui/dom/DOMPropertyOperations.js | 4 ++-- src/browser/ui/dom/DefaultDOMPropertyConfig.js | 4 ++-- .../ui/dom/__tests__/DOMPropertyOperations-test.js | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/browser/ui/dom/DOMProperty.js b/src/browser/ui/dom/DOMProperty.js index 6009f22347..6c88b11622 100644 --- a/src/browser/ui/dom/DOMProperty.js +++ b/src/browser/ui/dom/DOMProperty.js @@ -34,7 +34,7 @@ var DOMPropertyInjection = { HAS_BOOLEAN_VALUE: 0x8, HAS_NUMERIC_VALUE: 0x10, HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, - CAN_BE_MINIMIZED: 0x40, + HAS_BOOLEANISH_VALUE: 0x40, /** * Inject some specialized knowledge about the DOM. This takes a config object @@ -116,8 +116,8 @@ var DOMPropertyInjection = { propConfig & DOMPropertyInjection.HAS_NUMERIC_VALUE; DOMProperty.hasPositiveNumericValue[propName] = propConfig & DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE; - DOMProperty.canBeMinimized[propName] = - propConfig & DOMPropertyInjection.CAN_BE_MINIMIZED; + DOMProperty.hasBooleanishValue[propName] = + propConfig & DOMPropertyInjection.HAS_BOOLEANISH_VALUE; invariant( !DOMProperty.mustUseAttribute[propName] || @@ -139,8 +139,8 @@ var DOMPropertyInjection = { ); invariant( !DOMProperty.hasBooleanValue[propName] || - !DOMProperty.canBeMinimized[propName], - 'DOMProperty: Cannot have boolean value and be minimizable: %s', + !DOMProperty.hasBooleanishValue[propName], + 'DOMProperty: Cannot have boolean and booleanish value: %s', propName ); } @@ -246,7 +246,7 @@ var DOMProperty = { * to true; present with a value otherwise. * @type {Object} */ - canBeMinimized: {}, + hasBooleanishValue: {}, /** * All of the isCustomAttribute() functions that have been injected. diff --git a/src/browser/ui/dom/DOMPropertyOperations.js b/src/browser/ui/dom/DOMPropertyOperations.js index 8d4081d209..b364c81f86 100644 --- a/src/browser/ui/dom/DOMPropertyOperations.js +++ b/src/browser/ui/dom/DOMPropertyOperations.js @@ -30,7 +30,7 @@ function shouldIgnoreValue(name, value) { (DOMProperty.hasBooleanValue[name] && !value) || (DOMProperty.hasNumericValue[name] && isNaN(value)) || (DOMProperty.hasPositiveNumericValue[name] && (value < 1)) || - (DOMProperty.canBeMinimized[name] && value === false); + (DOMProperty.hasBooleanishValue[name] && value === false); } var processAttributeNameAndPrefix = memoizeStringOnly(function(name) { @@ -98,7 +98,7 @@ var DOMPropertyOperations = { } var attributeName = DOMProperty.getAttributeName[name]; if (DOMProperty.hasBooleanValue[name] || - (DOMProperty.canBeMinimized[name] && value === true)) { + (DOMProperty.hasBooleanishValue[name] && value === true)) { return escapeTextForBrowser(attributeName); } return processAttributeNameAndPrefix(attributeName) + diff --git a/src/browser/ui/dom/DefaultDOMPropertyConfig.js b/src/browser/ui/dom/DefaultDOMPropertyConfig.js index 865ee63028..82af1df961 100644 --- a/src/browser/ui/dom/DefaultDOMPropertyConfig.js +++ b/src/browser/ui/dom/DefaultDOMPropertyConfig.js @@ -29,7 +29,7 @@ var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; -var CAN_BE_MINIMIZED = DOMProperty.injection.CAN_BE_MINIMIZED; +var HAS_BOOLEANISH_VALUE = DOMProperty.injection.HAS_BOOLEANISH_VALUE; var DefaultDOMPropertyConfig = { isCustomAttribute: RegExp.prototype.test.bind( @@ -67,7 +67,7 @@ var DefaultDOMPropertyConfig = { defer: HAS_BOOLEAN_VALUE, dir: null, disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, - download: CAN_BE_MINIMIZED, + download: HAS_BOOLEANISH_VALUE, draggable: null, encType: null, form: MUST_USE_ATTRIBUTE, diff --git a/src/browser/ui/dom/__tests__/DOMPropertyOperations-test.js b/src/browser/ui/dom/__tests__/DOMPropertyOperations-test.js index 8055d17807..d0870716d4 100644 --- a/src/browser/ui/dom/__tests__/DOMPropertyOperations-test.js +++ b/src/browser/ui/dom/__tests__/DOMPropertyOperations-test.js @@ -99,7 +99,7 @@ describe('DOMPropertyOperations', function() { )).toBe(''); }); - it('should create markup for minimizable properties', function() { + it('should create markup for booleanish properties', function() { expect(DOMPropertyOperations.createMarkupForProperty( 'download', 'simple'