@@ -130,6 +130,7 @@ export function process_children(nodes, initial, is_element, { visit, state }) {
130130function is_static_element ( node , state ) {
131131 if ( node . type !== 'RegularElement' ) return false ;
132132 if ( node . fragment . metadata . dynamic ) return false ;
133+ if ( node . name . includes ( '-' ) ) return false ; // we're setting all attributes on custom elements through properties
133134
134135 for ( const attribute of node . attributes ) {
135136 if ( attribute . type !== 'Attribute' ) {
@@ -140,15 +141,6 @@ function is_static_element(node, state) {
140141 return false ;
141142 }
142143
143- if ( attribute . value !== true && ! is_text_attribute ( attribute ) ) {
144- // if it's not a text attribute but it's an inlinable expression
145- // we will inline it in the template so we can still consider it static
146- return is_inlinable_expression (
147- Array . isArray ( attribute . value ) ? attribute . value : [ attribute . value ] ,
148- state
149- ) ;
150- }
151-
152144 if ( attribute . name === 'autofocus' || attribute . name === 'muted' ) {
153145 return false ;
154146 }
@@ -162,8 +154,13 @@ function is_static_element(node, state) {
162154 return false ;
163155 }
164156
165- if ( node . name . includes ( '-' ) ) {
166- return false ; // we're setting all attributes on custom elements through properties
157+ if ( attribute . value !== true && ! is_text_attribute ( attribute ) ) {
158+ // if it's not a text attribute but it's an inlinable expression
159+ // we will inline it in the template so we can still consider it static
160+ return is_inlinable_expression (
161+ Array . isArray ( attribute . value ) ? attribute . value : [ attribute . value ] ,
162+ state
163+ ) ;
167164 }
168165 }
169166
0 commit comments