mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Support [LegacyWindowAlias]
This commit is contained in:
parent
118a9ecdfe
commit
e81b678645
9 changed files with 32 additions and 33 deletions
|
@ -238,6 +238,7 @@ pub fn create_noncallback_interface_object(
|
|||
interface_prototype_object: HandleObject,
|
||||
name: &[u8],
|
||||
length: u32,
|
||||
legacy_window_alias_names: &[&[u8]],
|
||||
rval: MutableHandleObject,
|
||||
) {
|
||||
create_object(
|
||||
|
@ -260,6 +261,12 @@ pub fn create_noncallback_interface_object(
|
|||
define_name(cx, rval.handle(), name);
|
||||
define_length(cx, rval.handle(), i32::try_from(length).expect("overflow"));
|
||||
define_on_global_object(cx, global, name, rval.handle());
|
||||
|
||||
if is_exposed_in(global, Globals::WINDOW) {
|
||||
for legacy_window_alias in legacy_window_alias_names {
|
||||
define_on_global_object(cx, global, legacy_window_alias, rval.handle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Create and define the named constructors of a non-callback interface.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue