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