@@ -3926,51 +3926,48 @@ function writeStyleResourceAttributeInJS(
3926
3926
return ;
3927
3927
3928
3928
// Attribute renames
3929
- case 'className ': {
3929
+ case 'className ':
3930
3930
attributeName = 'class ';
3931
- if ( __DEV__ ) {
3932
- checkAttributeStringCoercion ( value , attributeName ) ;
3933
- }
3934
- attributeValue = '' + ( value : any ) ;
3935
3931
break ;
3936
- }
3932
+
3937
3933
// Booleans
3938
- case 'hidden ': {
3934
+ case 'hidden ':
3939
3935
if ( value === false ) {
3940
3936
return ;
3941
3937
}
3942
3938
attributeValue = '';
3943
3939
break ;
3944
- }
3940
+
3945
3941
// Santized URLs
3946
3942
case 'src ':
3947
3943
case 'href ': {
3948
- value = sanitizeURL ( value ) ;
3949
3944
if ( __DEV__ ) {
3950
3945
checkAttributeStringCoercion ( value , attributeName ) ;
3951
3946
}
3952
- attributeValue = '' + ( value : any ) ;
3947
+ value = sanitizeURL ( value ) ;
3953
3948
break ;
3954
3949
}
3955
3950
default : {
3956
- if (
3957
- // unrecognized event handlers are not SSR'd and we (apparently)
3958
- // use on* as hueristic for these handler props
3959
- name . length > 2 &&
3960
- ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
3961
- ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
3962
- ) {
3963
- return ;
3964
- }
3965
3951
if ( ! isAttributeNameSafe ( name ) ) {
3966
3952
return ;
3967
3953
}
3968
- if ( __DEV__ ) {
3969
- checkAttributeStringCoercion ( value , attributeName ) ;
3970
- }
3971
- attributeValue = '' + ( value : any ) ;
3972
3954
}
3973
3955
}
3956
+
3957
+ if (
3958
+ // shouldIgnoreAttribute
3959
+ // We have already filtered out null/undefined and reserved words.
3960
+ name . length > 2 &&
3961
+ ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
3962
+ ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
3963
+ ) {
3964
+ return ;
3965
+ }
3966
+
3967
+ if ( __DEV__ ) {
3968
+ checkAttributeStringCoercion ( value , attributeName ) ;
3969
+ }
3970
+ attributeValue = '' + ( value : any ) ;
3974
3971
writeChunk ( destination , arrayInterstitial ) ;
3975
3972
writeChunk (
3976
3973
destination ,
@@ -4122,53 +4119,48 @@ function writeStyleResourceAttributeInAttr(
4122
4119
return ;
4123
4120
4124
4121
// Attribute renames
4125
- case 'className ': {
4122
+ case 'className ':
4126
4123
attributeName = 'class ';
4127
- if ( __DEV__ ) {
4128
- checkAttributeStringCoercion ( value , attributeName ) ;
4129
- }
4130
- attributeValue = '' + ( value : any ) ;
4131
4124
break ;
4132
- }
4133
4125
4134
4126
// Booleans
4135
- case 'hidden ': {
4127
+ case 'hidden ':
4136
4128
if ( value === false ) {
4137
4129
return ;
4138
4130
}
4139
4131
attributeValue = '';
4140
4132
break ;
4141
- }
4142
4133
4143
4134
// Santized URLs
4144
4135
case 'src ':
4145
4136
case 'href ': {
4146
- value = sanitizeURL ( value ) ;
4147
4137
if ( __DEV__ ) {
4148
4138
checkAttributeStringCoercion ( value , attributeName ) ;
4149
4139
}
4150
- attributeValue = '' + ( value : any ) ;
4140
+ value = sanitizeURL ( value ) ;
4151
4141
break ;
4152
4142
}
4153
4143
default : {
4154
- if (
4155
- // unrecognized event handlers are not SSR'd and we (apparently)
4156
- // use on* as hueristic for these handler props
4157
- name . length > 2 &&
4158
- ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
4159
- ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
4160
- ) {
4161
- return ;
4162
- }
4163
4144
if ( ! isAttributeNameSafe ( name ) ) {
4164
4145
return ;
4165
4146
}
4166
- if ( __DEV__ ) {
4167
- checkAttributeStringCoercion ( value , attributeName ) ;
4168
- }
4169
- attributeValue = '' + ( value : any ) ;
4170
4147
}
4171
4148
}
4149
+
4150
+ if (
4151
+ // shouldIgnoreAttribute
4152
+ // We have already filtered out null/undefined and reserved words.
4153
+ name . length > 2 &&
4154
+ ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
4155
+ ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
4156
+ ) {
4157
+ return ;
4158
+ }
4159
+
4160
+ if ( __DEV__ ) {
4161
+ checkAttributeStringCoercion ( value , attributeName ) ;
4162
+ }
4163
+ attributeValue = '' + ( value : any ) ;
4172
4164
writeChunk ( destination , arrayInterstitial ) ;
4173
4165
writeChunk (
4174
4166
destination ,
0 commit comments