Skip to main content

script/dom/testing/
testbindingproxy.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5// check-tidy: no specs after this line
6
7use dom_struct::dom_struct;
8use js::context::JSContext;
9
10use crate::dom::bindings::codegen::Bindings::TestBindingProxyBinding::TestBindingProxyMethods;
11use crate::dom::bindings::str::DOMString;
12use crate::dom::testbinding::TestBinding;
13
14#[dom_struct]
15pub(crate) struct TestBindingProxy {
16    testbinding_: TestBinding,
17}
18
19impl TestBindingProxyMethods<crate::DomTypeHolder> for TestBindingProxy {
20    fn Length(&self) -> u32 {
21        0
22    }
23    fn SupportedPropertyNames(&self, _: &mut JSContext) -> Vec<DOMString> {
24        vec![]
25    }
26    fn GetNamedItem(&self, _: DOMString) -> DOMString {
27        DOMString::new()
28    }
29    fn SetNamedItem(&self, _: DOMString, _: DOMString) {}
30    fn GetItem(&self, _: u32) -> DOMString {
31        DOMString::new()
32    }
33    fn SetItem(&self, _: u32, _: DOMString) {}
34    fn RemoveItem(&self, _: DOMString) {}
35    fn Stringifier(&self) -> DOMString {
36        DOMString::new()
37    }
38    fn IndexedGetter(&self, _: u32) -> Option<DOMString> {
39        None
40    }
41    fn NamedDeleter(&self, _: DOMString) {}
42    fn IndexedSetter(&self, _: u32, _: DOMString) {}
43    fn NamedSetter(&self, _: DOMString, _: DOMString) {}
44    fn NamedGetter(&self, _: DOMString) -> Option<DOMString> {
45        None
46    }
47}