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/domrectreadonly.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/domrectreadonly.rs')
-rw-r--r-- | components/script/dom/domrectreadonly.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/domrectreadonly.rs b/components/script/dom/domrectreadonly.rs index 49eed59ac58..80bb793857d 100644 --- a/components/script/dom/domrectreadonly.rs +++ b/components/script/dom/domrectreadonly.rs @@ -4,10 +4,11 @@ use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods; use crate::dom::bindings::error::Fallible; -use crate::dom::bindings::reflector::{reflect_dom_object, Reflector}; +use crate::dom::bindings::reflector::{reflect_dom_object2, Reflector}; use crate::dom::bindings::root::DomRoot; use crate::dom::globalscope::GlobalScope; use dom_struct::dom_struct; +use js::rust::HandleObject; use std::cell::Cell; #[dom_struct] @@ -30,28 +31,31 @@ impl DOMRectReadOnly { } } - pub fn new( + fn new( global: &GlobalScope, + proto: Option<HandleObject>, x: f64, y: f64, width: f64, height: f64, ) -> DomRoot<DOMRectReadOnly> { - reflect_dom_object( + reflect_dom_object2( Box::new(DOMRectReadOnly::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<DOMRectReadOnly>> { - Ok(DOMRectReadOnly::new(global, x, y, width, height)) + Ok(DOMRectReadOnly::new(global, proto, x, y, width, height)) } pub fn set_x(&self, value: f64) { |