mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
script: Refer to DOM interfaces with generic types in generated bindings. (#35457)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
14db055d46
commit
1192ae32b0
20 changed files with 627 additions and 167 deletions
|
@ -58,7 +58,6 @@ use crate::dom::htmlcollection::HTMLCollection;
|
|||
use crate::dom::htmlformcontrolscollection::HTMLFormControlsCollection;
|
||||
use crate::dom::htmloptionscollection::HTMLOptionsCollection;
|
||||
use crate::dom::nodelist::NodeList;
|
||||
use crate::dom::windowproxy::WindowProxy;
|
||||
|
||||
impl<T: Float + ToJSValConvertible> ToJSValConvertible for Finite<T> {
|
||||
#[inline]
|
||||
|
@ -425,10 +424,10 @@ where
|
|||
|
||||
/// Get a `DomRoot<T>` for a WindowProxy accessible from a `HandleValue`.
|
||||
/// Caller is responsible for throwing a JS exception if needed in case of error.
|
||||
pub(crate) unsafe fn windowproxy_from_handlevalue(
|
||||
pub(crate) unsafe fn windowproxy_from_handlevalue<D: crate::DomTypes>(
|
||||
v: HandleValue,
|
||||
_cx: *mut JSContext,
|
||||
) -> Result<DomRoot<WindowProxy>, ()> {
|
||||
) -> Result<DomRoot<D::WindowProxy>, ()> {
|
||||
if !v.get().is_object() {
|
||||
return Err(());
|
||||
}
|
||||
|
@ -438,6 +437,6 @@ pub(crate) unsafe fn windowproxy_from_handlevalue(
|
|||
}
|
||||
let mut value = UndefinedValue();
|
||||
GetProxyReservedSlot(object, 0, &mut value);
|
||||
let ptr = value.to_private() as *const WindowProxy;
|
||||
let ptr = value.to_private() as *const D::WindowProxy;
|
||||
Ok(DomRoot::from_ref(&*ptr))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue