@@ -22,13 +22,12 @@ var DOMPropertyInjection = {
22
22
* Mapping from normalized, camelcased property names to a configuration that
23
23
* specifies how the associated DOM property should be accessed or rendered.
24
24
*/
25
- MUST_USE_ATTRIBUTE : 0x1 ,
26
- MUST_USE_PROPERTY : 0x2 ,
27
- HAS_SIDE_EFFECTS : 0x4 ,
28
- HAS_BOOLEAN_VALUE : 0x8 ,
29
- HAS_NUMERIC_VALUE : 0x10 ,
30
- HAS_POSITIVE_NUMERIC_VALUE : 0x20 | 0x10 ,
31
- HAS_OVERLOADED_BOOLEAN_VALUE : 0x40 ,
25
+ MUST_USE_PROPERTY : 0x1 ,
26
+ HAS_SIDE_EFFECTS : 0x2 ,
27
+ HAS_BOOLEAN_VALUE : 0x4 ,
28
+ HAS_NUMERIC_VALUE : 0x8 ,
29
+ HAS_POSITIVE_NUMERIC_VALUE : 0x10 | 0x8 ,
30
+ HAS_OVERLOADED_BOOLEAN_VALUE : 0x20 ,
32
31
33
32
/**
34
33
* Inject some specialized knowledge about the DOM. This takes a config object
@@ -91,7 +90,6 @@ var DOMPropertyInjection = {
91
90
propertyName : propName ,
92
91
mutationMethod : null ,
93
92
94
- mustUseAttribute : checkMask ( propConfig , Injection . MUST_USE_ATTRIBUTE ) ,
95
93
mustUseProperty : checkMask ( propConfig , Injection . MUST_USE_PROPERTY ) ,
96
94
hasSideEffects : checkMask ( propConfig , Injection . HAS_SIDE_EFFECTS ) ,
97
95
hasBooleanValue : checkMask ( propConfig , Injection . HAS_BOOLEAN_VALUE ) ,
@@ -102,11 +100,6 @@ var DOMPropertyInjection = {
102
100
checkMask ( propConfig , Injection . HAS_OVERLOADED_BOOLEAN_VALUE ) ,
103
101
} ;
104
102
105
- invariant (
106
- ! propertyInfo . mustUseAttribute || ! propertyInfo . mustUseProperty ,
107
- 'DOMProperty: Cannot require using both attribute and property: %s' ,
108
- propName
109
- ) ;
110
103
invariant (
111
104
propertyInfo . mustUseProperty || ! propertyInfo . hasSideEffects ,
112
105
'DOMProperty: Properties that have side effects must use property: %s' ,
@@ -148,7 +141,6 @@ var DOMPropertyInjection = {
148
141
}
149
142
} ,
150
143
} ;
151
- var defaultValueCache = { } ;
152
144
153
145
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD' ;
154
146
@@ -186,9 +178,6 @@ var DOMProperty = {
186
178
* mutationMethod:
187
179
* If non-null, used instead of the property or `setAttribute()` after
188
180
* initial render.
189
- * mustUseAttribute:
190
- * Whether the property must be accessed and mutated using `*Attribute()`.
191
- * (This includes anything that fails `<propName> in <element>`.)
192
181
* mustUseProperty:
193
182
* Whether the property must be accessed and mutated as an object property.
194
183
* hasSideEffects:
@@ -237,27 +226,6 @@ var DOMProperty = {
237
226
return false ;
238
227
} ,
239
228
240
- /**
241
- * Returns the default property value for a DOM property (i.e., not an
242
- * attribute). Most default values are '' or false, but not all. Worse yet,
243
- * some (in particular, `type`) vary depending on the type of element.
244
- *
245
- * TODO: Is it better to grab all the possible properties when creating an
246
- * element to avoid having to create the same element twice?
247
- */
248
- getDefaultValueForProperty : function ( nodeName , prop ) {
249
- var nodeDefaults = defaultValueCache [ nodeName ] ;
250
- var testElement ;
251
- if ( ! nodeDefaults ) {
252
- defaultValueCache [ nodeName ] = nodeDefaults = { } ;
253
- }
254
- if ( ! ( prop in nodeDefaults ) ) {
255
- testElement = document . createElement ( nodeName ) ;
256
- nodeDefaults [ prop ] = testElement [ prop ] ;
257
- }
258
- return nodeDefaults [ prop ] ;
259
- } ,
260
-
261
229
injection : DOMPropertyInjection ,
262
230
} ;
263
231
0 commit comments