diff options
author | Josh Matthews <josh@joshmatthews.net> | 2023-05-28 22:43:55 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2023-05-28 23:23:12 -0400 |
commit | dbff26bce05d404027ef5bbfd85fb5995e4726bc (patch) | |
tree | 6ebb631eef396c2f387fe8269b0d59bde0dccae2 /components/script/dom/bindings/htmlconstructor.rs | |
parent | d9600ff50f3c1bdd8c44e2dfc15a18416d80cb82 (diff) | |
download | servo-dbff26bce05d404027ef5bbfd85fb5995e4726bc.tar.gz servo-dbff26bce05d404027ef5bbfd85fb5995e4726bc.zip |
Support arbitrary protos when wrapping DOM objects with constructors.
Diffstat (limited to 'components/script/dom/bindings/htmlconstructor.rs')
-rw-r--r-- | components/script/dom/bindings/htmlconstructor.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/bindings/htmlconstructor.rs b/components/script/dom/bindings/htmlconstructor.rs index 76d717ff4b7..5d74f153c8b 100644 --- a/components/script/dom/bindings/htmlconstructor.rs +++ b/components/script/dom/bindings/htmlconstructor.rs @@ -225,10 +225,12 @@ unsafe fn html_constructor( None => { // Step 8.1 let name = QualName::new(None, ns!(html), definition.local_name.clone()); + // Any prototype used to create these elements will be overwritten before returning + // from this function, so we don't bother overwriting the defaults here. let element = if definition.is_autonomous() { - DomRoot::upcast(HTMLElement::new(name.local, None, &*document)) + DomRoot::upcast(HTMLElement::new(name.local, None, &*document, None)) } else { - create_native_html_element(name, None, &*document, ElementCreator::ScriptCreated) + create_native_html_element(name, None, &*document, ElementCreator::ScriptCreated, None) }; // Step 8.2 is performed in the generated caller code. |