aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domrect.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/domrect.rs')
-rw-r--r--components/script/dom/domrect.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/components/script/dom/domrect.rs b/components/script/dom/domrect.rs
index d925176f96d..8ab7daa2b57 100644
--- a/components/script/dom/domrect.rs
+++ b/components/script/dom/domrect.rs
@@ -5,11 +5,12 @@
use crate::dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods;
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
use crate::dom::bindings::error::Fallible;
-use crate::dom::bindings::reflector::reflect_dom_object;
+use crate::dom::bindings::reflector::reflect_dom_object2;
use crate::dom::bindings::root::DomRoot;
use crate::dom::domrectreadonly::DOMRectReadOnly;
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
+use js::rust::HandleObject;
#[dom_struct]
pub struct DOMRect {
@@ -24,21 +25,27 @@ impl DOMRect {
}
pub fn new(global: &GlobalScope, x: f64, y: f64, width: f64, height: f64) -> DomRoot<DOMRect> {
- reflect_dom_object(
+ Self::new_with_proto(global, None, x, y, width, height)
+ }
+
+ fn new_with_proto(global: &GlobalScope, proto: Option<HandleObject>, x: f64, y: f64, width: f64, height: f64) -> DomRoot<DOMRect> {
+ reflect_dom_object2(
Box::new(DOMRect::new_inherited(x, y, width, height)),
global,
+ proto,
)
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
+ proto: Option<HandleObject>,
x: f64,
y: f64,
width: f64,
height: f64,
) -> Fallible<DomRoot<DOMRect>> {
- Ok(DOMRect::new(global, x, y, width, height))
+ Ok(DOMRect::new_with_proto(global, proto, x, y, width, height))
}
}