@@ -170,32 +170,33 @@ function getRuntimeHelper(
170
170
) : HelperConfig {
171
171
const tagName = tag . toUpperCase ( )
172
172
const isSVG = isSVGTag ( tag )
173
+
174
+ // 1. SVG: always attribute
175
+ if ( isSVG ) {
176
+ // TODO pass svg flag
177
+ return helpers . setAttr
178
+ }
179
+
173
180
if ( modifier ) {
174
181
if ( modifier === '.' ) {
175
- return getSpecialHelper ( key , tagName , isSVG ) || helpers . setDOMProp
182
+ return getSpecialHelper ( key , tagName ) || helpers . setDOMProp
176
183
} else {
177
184
return helpers . setAttr
178
185
}
179
186
}
180
187
181
- // 1 . special handling for value / style / class / textContent / innerHTML
182
- const helper = getSpecialHelper ( key , tagName , isSVG )
188
+ // 2 . special handling for value / style / class / textContent / innerHTML
189
+ const helper = getSpecialHelper ( key , tagName )
183
190
if ( helper ) {
184
191
return helper
185
192
}
186
193
187
- // 2 . Aria DOM properties shared between all Elements in
194
+ // 3 . Aria DOM properties shared between all Elements in
188
195
// https://developer.mozilla.org/en-US/docs/Web/API/Element
189
196
if ( / a r i a [ A - Z ] / . test ( key ) ) {
190
197
return helpers . setDOMProp
191
198
}
192
199
193
- // 3. SVG: always attribute
194
- if ( isSVG ) {
195
- // TODO pass svg flag
196
- return helpers . setAttr
197
- }
198
-
199
200
// 4. respect shouldSetAsAttr used in vdom and setDynamicProp for consistency
200
201
// also fast path for presence of hyphen (covers data-* and aria-*)
201
202
if ( shouldSetAsAttr ( tagName , key ) || key . includes ( '-' ) ) {
@@ -210,13 +211,12 @@ function getRuntimeHelper(
210
211
function getSpecialHelper (
211
212
keyName : string ,
212
213
tagName : string ,
213
- isSVG : boolean ,
214
214
) : HelperConfig | undefined {
215
215
// special case for 'value' property
216
216
if ( keyName === 'value' && canSetValueDirectly ( tagName ) ) {
217
217
return helpers . setValue
218
218
} else if ( keyName === 'class' ) {
219
- return isSVG ? helpers . setAttr : helpers . setClass
219
+ return helpers . setClass
220
220
} else if ( keyName === 'style' ) {
221
221
return helpers . setStyle
222
222
} else if ( keyName === 'innerHTML' ) {
0 commit comments