script/dom/
pluginarray.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
5use dom_struct::dom_struct;
6
7use crate::dom::bindings::codegen::Bindings::PluginArrayBinding::PluginArrayMethods;
8use crate::dom::bindings::reflector::{Reflector, reflect_dom_object};
9use crate::dom::bindings::root::DomRoot;
10use crate::dom::bindings::str::DOMString;
11use crate::dom::globalscope::GlobalScope;
12use crate::dom::plugin::Plugin;
13use crate::script_runtime::CanGc;
14
15#[dom_struct]
16pub(crate) struct PluginArray {
17    reflector_: Reflector,
18}
19
20impl PluginArray {
21    pub(crate) fn new_inherited() -> PluginArray {
22        PluginArray {
23            reflector_: Reflector::new(),
24        }
25    }
26
27    pub(crate) fn new(global: &GlobalScope, can_gc: CanGc) -> DomRoot<PluginArray> {
28        reflect_dom_object(Box::new(PluginArray::new_inherited()), global, can_gc)
29    }
30}
31
32impl PluginArrayMethods<crate::DomTypeHolder> for PluginArray {
33    // https://html.spec.whatwg.org/multipage/#dom-pluginarray-refresh
34    fn Refresh(&self, _reload: bool) {}
35
36    // https://html.spec.whatwg.org/multipage/#dom-pluginarray-length
37    fn Length(&self) -> u32 {
38        0
39    }
40
41    // https://html.spec.whatwg.org/multipage/#dom-pluginarray-item
42    fn Item(&self, _index: u32) -> Option<DomRoot<Plugin>> {
43        None
44    }
45
46    // https://html.spec.whatwg.org/multipage/#dom-pluginarray-nameditem
47    fn NamedItem(&self, _name: DOMString) -> Option<DomRoot<Plugin>> {
48        None
49    }
50
51    // https://html.spec.whatwg.org/multipage/#dom-pluginarray-item
52    fn IndexedGetter(&self, _index: u32) -> Option<DomRoot<Plugin>> {
53        None
54    }
55
56    // check-tidy: no specs after this line
57    fn NamedGetter(&self, _name: DOMString) -> Option<DomRoot<Plugin>> {
58        None
59    }
60
61    // https://heycam.github.io/webidl/#dfn-supported-property-names
62    fn SupportedPropertyNames(&self) -> Vec<DOMString> {
63        vec![]
64    }
65}