aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/htmlconstructor.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-05-28 22:43:55 -0400
committerJosh Matthews <josh@joshmatthews.net>2023-05-28 23:23:12 -0400
commitdbff26bce05d404027ef5bbfd85fb5995e4726bc (patch)
tree6ebb631eef396c2f387fe8269b0d59bde0dccae2 /components/script/dom/bindings/htmlconstructor.rs
parentd9600ff50f3c1bdd8c44e2dfc15a18416d80cb82 (diff)
downloadservo-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.rs6
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.