@@ -194,8 +194,9 @@ fn create_html_element(
194194 // local name set to localName, custom element state set to "failed",
195195 // custom element definition set to null, is value set to null,
196196 // and node document set to document.
197+ // TODO: check if is_defined is correct
197198 let element = DomRoot :: upcast :: < Element > ( HTMLUnknownElement :: new (
198- local_name, prefix, document, proto, can_gc,
199+ local_name, prefix, document, proto, false , can_gc,
199200 ) ) ;
200201 element. set_custom_element_state ( CustomElementState :: Failed ) ;
201202 element
@@ -214,6 +215,7 @@ fn create_html_element(
214215 prefix. clone ( ) ,
215216 document,
216217 proto,
218+ false ,
217219 can_gc,
218220 ) ) ;
219221 result. set_custom_element_state ( CustomElementState :: Undefined ) ;
@@ -258,25 +260,25 @@ pub(crate) fn create_native_html_element(
258260 document : & Document ,
259261 creator : ElementCreator ,
260262 proto : Option < HandleObject > ,
261- defined : bool ,
263+ is_defined : bool ,
262264) -> DomRoot < Element > {
263265 assert_eq ! ( name. ns, ns!( html) ) ;
264266
265267 macro_rules! make(
266268 ( $ctor: ident) => ( {
267- let obj = $ctor:: new( name. local, prefix, document, proto, defined , CanGc :: note( ) ) ;
269+ let obj = $ctor:: new( name. local, prefix, document, proto, is_defined , CanGc :: note( ) ) ;
268270 DomRoot :: upcast( obj)
269271 } ) ;
270272 ( $ctor: ident, $( $arg: expr) ,+) => ( {
271- let obj = $ctor:: new( name. local, prefix, document, proto, $( $arg) ,+, CanGc :: note( ) ) ;
273+ let obj = $ctor:: new( name. local, prefix, document, proto, $( $arg) ,+, is_defined , CanGc :: note( ) ) ;
272274 DomRoot :: upcast( obj)
273275 } )
274276 ) ;
275277
276278 // This is a big match, and the IDs for inline-interned atoms are not very structured.
277279 // Perhaps we should build a perfect hash from those IDs instead.
278280 // https://html.spec.whatwg.org/multipage/#elements-in-the-dom
279- let element : DomRoot < Element > = match name. local {
281+ match name. local {
280282 local_name ! ( "a" ) => make ! ( HTMLAnchorElement ) ,
281283 local_name ! ( "abbr" ) => make ! ( HTMLElement ) ,
282284 local_name ! ( "acronym" ) => make ! ( HTMLElement ) ,
@@ -424,13 +426,7 @@ pub(crate) fn create_native_html_element(
424426 local_name ! ( "xmp" ) => make ! ( HTMLPreElement ) ,
425427 _ if is_valid_custom_element_name ( & name. local ) => make ! ( HTMLElement ) ,
426428 _ => make ! ( HTMLUnknownElement ) ,
427- } ;
428-
429- if defined {
430- element. force_defined ( ) ;
431429 }
432-
433- element
434430}
435431
436432pub ( crate ) fn create_element (
0 commit comments