aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py4
-rw-r--r--components/script/dom/bindings/htmlconstructor.rs6
-rw-r--r--components/script/dom/bindings/reflector.rs4
3 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 5ed330083b9..b0f89c6a1d3 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -6147,9 +6147,7 @@ let global = DomRoot::downcast::<dom::types::%s>(global).unwrap();
else:
name = self.constructor.identifier.name
nativeName = MakeNativeName(self.descriptor.binaryNameFor(name))
- args = ["&global"]
- if self.descriptor.interface.identifier.name == "EventTarget":
- args += ["desired_proto.handle()"]
+ args = ["&global", "Some(desired_proto.handle())"]
constructorCall = CGMethodCall(args, nativeName, True,
self.descriptor, self.constructor)
return CGList([preamble, constructorCall])
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.
diff --git a/components/script/dom/bindings/reflector.rs b/components/script/dom/bindings/reflector.rs
index 32c3d7645e1..418cad032e3 100644
--- a/components/script/dom/bindings/reflector.rs
+++ b/components/script/dom/bindings/reflector.rs
@@ -26,13 +26,13 @@ where
unsafe { T::WRAP(GlobalScope::get_cx(), global_scope, None, obj) }
}
-pub fn reflect_dom_object2<T, U>(obj: Box<T>, global: &U, proto: HandleObject) -> DomRoot<T>
+pub fn reflect_dom_object2<T, U>(obj: Box<T>, global: &U, proto: Option<HandleObject>) -> DomRoot<T>
where
T: DomObject + DomObjectWrap,
U: DerivedFrom<GlobalScope>,
{
let global_scope = global.upcast();
- unsafe { T::WRAP(GlobalScope::get_cx(), global_scope, Some(proto), obj) }
+ unsafe { T::WRAP(GlobalScope::get_cx(), global_scope, proto, obj) }
}
/// A struct to store a reference to the reflector of a DOM object.