diff options
author | Josh Matthews <josh@joshmatthews.net> | 2024-11-24 02:35:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-24 07:35:14 +0000 |
commit | e956f3124c230549c6ef4a63e2c27e56d0965453 (patch) | |
tree | 816ba96fcb8470265f72629fe3e1b182e92972a6 /components/script/dom/staticrange.rs | |
parent | 468f9cf014c9dc41e43974ab17fb790e42d7e6ee (diff) | |
download | servo-e956f3124c230549c6ef4a63e2c27e56d0965453.tar.gz servo-e956f3124c230549c6ef4a63e2c27e56d0965453.zip |
Generate a trait abstracting over all known DOM interfaces (#34357)
* script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Update trait implementations with new generic type.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/staticrange.rs')
-rw-r--r-- | components/script/dom/staticrange.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/staticrange.rs b/components/script/dom/staticrange.rs index 273beb16ad0..31c4e276338 100644 --- a/components/script/dom/staticrange.rs +++ b/components/script/dom/staticrange.rs @@ -6,7 +6,9 @@ use dom_struct::dom_struct; use js::rust::HandleObject; use crate::dom::abstractrange::AbstractRange; -use crate::dom::bindings::codegen::Bindings::StaticRangeBinding::StaticRangeInit; +use crate::dom::bindings::codegen::Bindings::StaticRangeBinding::{ + StaticRangeInit, StaticRangeMethods, +}; use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use crate::dom::bindings::error::{Error, Fallible}; use crate::dom::bindings::inheritance::NodeTypeId; @@ -66,10 +68,12 @@ impl StaticRange { ); staticrange } +} +impl StaticRangeMethods<crate::DomTypeHolder> for StaticRange { /// <https://dom.spec.whatwg.org/#dom-staticrange-staticrange> #[allow(non_snake_case)] - pub fn Constructor( + fn Constructor( window: &Window, proto: Option<HandleObject>, can_gc: CanGc, |