From 230b8f61fdcd8cbbc78f977edf2d334ab5ade262 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 28 Sep 2018 21:39:58 -0700 Subject: [PATCH] Fix WebIDL mixin attributes on `Window` Previously the "container attribute" were set to the attributes of the mixin itself, but we want the container attributes to be that of the type which includes the mixin (like `Window`) as those attributes contain information about whether or not bindings are `structural`. The end result with this is that the `structural` tag is now used for properties on `Window`, correctly generating setters/getters. Closes #904 --- crates/web-sys/tests/wasm/indexeddb.rs | 8 ++++++++ crates/web-sys/tests/wasm/main.rs | 1 + crates/webidl/src/lib.rs | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 crates/web-sys/tests/wasm/indexeddb.rs diff --git a/crates/web-sys/tests/wasm/indexeddb.rs b/crates/web-sys/tests/wasm/indexeddb.rs new file mode 100644 index 00000000..b85c3e43 --- /dev/null +++ b/crates/web-sys/tests/wasm/indexeddb.rs @@ -0,0 +1,8 @@ +use wasm_bindgen_test::*; +use web_sys; + +#[wasm_bindgen_test] +fn accessor_works() { + let window = web_sys::window().unwrap(); + assert!(window.indexed_db().unwrap().is_some()); +} diff --git a/crates/web-sys/tests/wasm/main.rs b/crates/web-sys/tests/wasm/main.rs index ce221e16..71d88fff 100644 --- a/crates/web-sys/tests/wasm/main.rs +++ b/crates/web-sys/tests/wasm/main.rs @@ -55,3 +55,4 @@ pub mod style_element; pub mod table_element; pub mod title_element; pub mod xpath_result; +pub mod indexeddb; diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 4f37aadd..fc6bab60 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -568,7 +568,7 @@ impl<'src> FirstPassRecord<'src> { &member.type_, member.identifier.0, &member.attributes, - mixin_data.definition_attributes, + data.definition_attributes, ); } }