aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/interface.rs
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2019-10-17 19:41:47 +0900
committerKagami Sascha Rosylight <saschanaz@outlook.com>2019-10-19 12:01:00 +0900
commite81b6786457b076a06c945835a3080fa33fa81ca (patch)
tree8e0808ea45ced9929b43b868717e80a634136adf /components/script/dom/bindings/interface.rs
parent118a9ecdfe5005a0f3328c362ce8d7a7f1b52912 (diff)
downloadservo-e81b6786457b076a06c945835a3080fa33fa81ca.tar.gz
servo-e81b6786457b076a06c945835a3080fa33fa81ca.zip
Support [LegacyWindowAlias]
Diffstat (limited to 'components/script/dom/bindings/interface.rs')
-rw-r--r--components/script/dom/bindings/interface.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs
index 0a5ee24fb23..2514efcf063 100644
--- a/components/script/dom/bindings/interface.rs
+++ b/components/script/dom/bindings/interface.rs
@@ -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.