@@ -8,6 +8,7 @@ import Expression from '../../../nodes/shared/Expression';
8
8
import Text from '../../../nodes/Text' ;
9
9
import handle_select_value_binding from './handle_select_value_binding' ;
10
10
import { Identifier , Node } from 'estree' ;
11
+ import { external } from '../../../../utils/namespaces' ;
11
12
12
13
export class BaseAttributeWrapper {
13
14
node : Attribute ;
@@ -67,15 +68,27 @@ export default class AttributeWrapper extends BaseAttributeWrapper {
67
68
}
68
69
}
69
70
70
- this . name = fix_attribute_casing ( this . node . name ) ;
71
- this . metadata = this . get_metadata ( ) ;
72
- this . is_indirectly_bound_value = is_indirectly_bound_value ( this ) ;
73
- this . property_name = this . is_indirectly_bound_value
74
- ? '__value'
75
- : this . metadata && this . metadata . property_name ;
71
+ if ( this . parent . node . namespace && this . parent . node . namespace == external ) {
72
+ // leave attribute case alone for elements in the "external" namespace
73
+ this . name = this . node . name ;
74
+ this . metadata = this . get_metadata ( ) ;
75
+ // since this is an external namespace, the following flags/properties can't apply
76
+ this . is_indirectly_bound_value = false ;
77
+ this . property_name = null ;
78
+ this . is_select_value_attribute = false ;
79
+ this . is_input_value = false ;
80
+ } else {
81
+ this . name = fix_attribute_casing ( this . node . name ) ;
82
+ this . metadata = this . get_metadata ( ) ;
83
+ this . is_indirectly_bound_value = is_indirectly_bound_value ( this ) ;
84
+ this . property_name = this . is_indirectly_bound_value
85
+ ? '__value'
86
+ : this . metadata && this . metadata . property_name ;
87
+ this . is_select_value_attribute = this . name === 'value' && this . parent . node . name === 'select' ;
88
+ this . is_input_value = this . name === 'value' && this . parent . node . name === 'input' ;
89
+ }
90
+
76
91
this . is_src = this . name === 'src' ; // TODO retire this exception in favour of https://github.com/sveltejs/svelte/issues/3750
77
- this . is_select_value_attribute = this . name === 'value' && this . parent . node . name === 'select' ;
78
- this . is_input_value = this . name === 'value' && this . parent . node . name === 'input' ;
79
92
this . should_cache = should_cache ( this ) ;
80
93
}
81
94
0 commit comments