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>
This commit is contained in:
Josh Matthews 2024-11-24 02:35:14 -05:00 committed by GitHub
parent 468f9cf014
commit e956f3124c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
383 changed files with 550 additions and 385 deletions

View file

@ -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,