aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/interface.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-10-18 23:23:28 -0400
committerGitHub <noreply@github.com>2019-10-18 23:23:28 -0400
commit605ddbecd4dfbbb67849cf63774b2d7635fc3601 (patch)
tree8e0808ea45ced9929b43b868717e80a634136adf /components/script/dom/bindings/interface.rs
parent118a9ecdfe5005a0f3328c362ce8d7a7f1b52912 (diff)
parente81b6786457b076a06c945835a3080fa33fa81ca (diff)
downloadservo-605ddbecd4dfbbb67849cf63774b2d7635fc3601.tar.gz
servo-605ddbecd4dfbbb67849cf63774b2d7635fc3601.zip
Auto merge of #24475 - saschanaz:legacywindowalias, r=jdm
Support [LegacyWindowAlias] <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24474 (GitHub issue number if applicable) <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
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.