Rename CAN_BE_MINIMIZED to HAS_BOOLEANISH_VALUE
Matthew Dapena-Tretter committed
Apr 3, 2014 at 21:21 UTC
77ae237be945b6e202016fb420e0bc246e6eed5b
4 files changed
+11
-11
src/browser/ui/dom/DOMProperty.js
+6
-6
@@ -34,7 +34,7 @@ var DOMPropertyInjection = {
34
HAS_BOOLEAN_VALUE: 0x8,
35
HAS_NUMERIC_VALUE: 0x10,
36
HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
37
- CAN_BE_MINIMIZED: 0x40,
37
+ HAS_BOOLEANISH_VALUE: 0x40,
38
39
/**
40
* Inject some specialized knowledge about the DOM. This takes a config object
@@ -116,8 +116,8 @@ var DOMPropertyInjection = {
116
propConfig & DOMPropertyInjection.HAS_NUMERIC_VALUE;
117
DOMProperty.hasPositiveNumericValue[propName] =
118
propConfig & DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE;
119
- DOMProperty.canBeMinimized[propName] =
120
- propConfig & DOMPropertyInjection.CAN_BE_MINIMIZED;
119
+ DOMProperty.hasBooleanishValue[propName] =
120
+ propConfig & DOMPropertyInjection.HAS_BOOLEANISH_VALUE;
121
122
invariant(
123
!DOMProperty.mustUseAttribute[propName] ||
@@ -139,8 +139,8 @@ var DOMPropertyInjection = {
139
);
140
invariant(
141
!DOMProperty.hasBooleanValue[propName] ||
142
- !DOMProperty.canBeMinimized[propName],
143
- 'DOMProperty: Cannot have boolean value and be minimizable: %s',
142
+ !DOMProperty.hasBooleanishValue[propName],
143
+ 'DOMProperty: Cannot have boolean and booleanish value: %s',
144
propName
145
);
146
}
@@ -246,7 +246,7 @@ var DOMProperty = {
246
* to true; present with a value otherwise.
247
* @type {Object}
248
*/
249
- canBeMinimized: {},
249
+ hasBooleanishValue: {},
250
251
/**
252
* All of the isCustomAttribute() functions that have been injected.
src/browser/ui/dom/DOMPropertyOperations.js
+2
-2
@@ -30,7 +30,7 @@ function shouldIgnoreValue(name, value) {
30
(DOMProperty.hasBooleanValue[name] && !value) ||
31
(DOMProperty.hasNumericValue[name] && isNaN(value)) ||
32
(DOMProperty.hasPositiveNumericValue[name] && (value < 1)) ||
33
- (DOMProperty.canBeMinimized[name] && value === false);
33
+ (DOMProperty.hasBooleanishValue[name] && value === false);
34
}
35
36
var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
@@ -98,7 +98,7 @@ var DOMPropertyOperations = {
98
}
99
var attributeName = DOMProperty.getAttributeName[name];
100
if (DOMProperty.hasBooleanValue[name] ||
101
- (DOMProperty.canBeMinimized[name] && value === true)) {
101
+ (DOMProperty.hasBooleanishValue[name] && value === true)) {
102
return escapeTextForBrowser(attributeName);
103
}
104
return processAttributeNameAndPrefix(attributeName) +
src/browser/ui/dom/DefaultDOMPropertyConfig.js
+2
-2
@@ -29,7 +29,7 @@ var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
29
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
30
var HAS_POSITIVE_NUMERIC_VALUE =
31
DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
32
-var CAN_BE_MINIMIZED = DOMProperty.injection.CAN_BE_MINIMIZED;
32
+var HAS_BOOLEANISH_VALUE = DOMProperty.injection.HAS_BOOLEANISH_VALUE;
33
34
var DefaultDOMPropertyConfig = {
35
isCustomAttribute: RegExp.prototype.test.bind(
@@ -67,7 +67,7 @@ var DefaultDOMPropertyConfig = {
67
defer: HAS_BOOLEAN_VALUE,
68
dir: null,
69
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
70
- download: CAN_BE_MINIMIZED,
70
+ download: HAS_BOOLEANISH_VALUE,
71
draggable: null,
72
encType: null,
73
form: MUST_USE_ATTRIBUTE,
src/browser/ui/dom/__tests__/DOMPropertyOperations-test.js
+1
-1
@@ -99,7 +99,7 @@ describe('DOMPropertyOperations', function() {
99
)).toBe('');
100
});
101
102
- it('should create markup for minimizable properties', function() {
102
+ it('should create markup for booleanish properties', function() {
103
expect(DOMPropertyOperations.createMarkupForProperty(
104
'download',
105
'simple'