@@ -100,7 +100,6 @@ var DOMPropertyInjection = {
100
100
101
101
var propertyInfo = {
102
102
hasBooleanValue : checkMask ( propConfig , Injection . HAS_BOOLEAN_VALUE ) ,
103
- hasNumericValue : checkMask ( propConfig , Injection . HAS_NUMERIC_VALUE ) ,
104
103
hasOverloadedBooleanValue : checkMask (
105
104
propConfig ,
106
105
Injection . HAS_OVERLOADED_BOOLEAN_VALUE ,
@@ -111,9 +110,7 @@ var DOMPropertyInjection = {
111
110
) ,
112
111
} ;
113
112
invariant (
114
- propertyInfo . hasBooleanValue +
115
- propertyInfo . hasNumericValue +
116
- propertyInfo . hasOverloadedBooleanValue <=
113
+ propertyInfo . hasBooleanValue + propertyInfo . hasOverloadedBooleanValue <=
117
114
1 ,
118
115
'DOMProperty: Value can be one of boolean, overloaded boolean, or ' +
119
116
'numeric value, but not a combination: %s' ,
@@ -286,9 +283,6 @@ var DOMProperty = {
286
283
*
287
284
* hasBooleanValue:
288
285
* Whether the property should be removed when set to a falsey value.
289
- * hasNumericValue:
290
- * Whether the property must be numeric or parse as a numeric and should be
291
- * removed when set to a falsey value.
292
286
* hasOverloadedBooleanValue:
293
287
* Whether the property can be used as a flag as well as with a value.
294
288
* Removed when strictly equal to false; present without a value when
@@ -368,30 +362,32 @@ var DOMProperty = {
368
362
: null ;
369
363
} ,
370
364
371
- // Whether the property must be positive numeric or parse as a positive
372
- // numeric and should be removed when set to a falsey value.
373
- isExpectingPositiveValue ( propName ) {
374
- switch ( propName ) {
365
+ shouldIgnoreValue ( name , value ) {
366
+ if ( value == null ) {
367
+ return true ;
368
+ }
369
+ switch ( name ) {
370
+ // Numeric properties.
371
+ case 'rowSpan' :
372
+ case 'start' :
373
+ return isNaN ( value ) ;
374
+ // Positive numeric properties.
375
375
case 'cols' :
376
376
case 'rows' :
377
377
case 'size' :
378
378
case 'span' :
379
- return true ;
379
+ return isNaN ( value ) || value < 1 ;
380
380
default :
381
+ var propertyInfo = DOMProperty . getPropertyInfo ( name ) ;
382
+ if ( propertyInfo . hasBooleanValue && ! value ) {
383
+ return true ;
384
+ }
385
+ if ( propertyInfo . hasOverloadedBooleanValue && value === false ) {
386
+ return true ;
387
+ }
381
388
return false ;
382
389
}
383
- } ,
384
-
385
- shouldIgnoreValue ( name , value ) {
386
- var propertyInfo = DOMProperty . getPropertyInfo ( name ) ;
387
- return (
388
- value == null ||
389
- ( propertyInfo . hasBooleanValue && ! value ) ||
390
- ( propertyInfo . hasNumericValue &&
391
- ( isNaN ( value ) ||
392
- ( DOMProperty . isExpectingPositiveValue ( name ) && value < 1 ) ) ) ||
393
- ( propertyInfo . hasOverloadedBooleanValue && value === false )
394
- ) ;
390
+ return false ;
395
391
} ,
396
392
397
393
shouldUseProperty ( propName ) {
0 commit comments