aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/navigator.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-11 21:17:16 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-11 21:17:16 +0530
commit3b7e426d33e539303f46a0a153752683838186fc (patch)
tree4c08133c3c7e4fcafb87f19472796f2e1b1dd5d4 /components/script/dom/navigator.rs
parentf9f3b7529ba2c66b6203b0742c4cd89d03ddd772 (diff)
parente83d29a7eb9db1ba08059436e9dce1db0165251b (diff)
downloadservo-3b7e426d33e539303f46a0a153752683838186fc.tar.gz
servo-3b7e426d33e539303f46a0a153752683838186fc.zip
Auto merge of #10485 - ConnorGBrewster:navigator_plugins, r=Ms2ger
Implement stub for NavigatorPlugins This PR implements stub for NavigatorPlugins as outlined in #9991. r? @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10485) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/navigator.rs')
-rw-r--r--components/script/dom/navigator.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs
index fe01105b787..c1874905a54 100644
--- a/components/script/dom/navigator.rs
+++ b/components/script/dom/navigator.rs
@@ -8,7 +8,9 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::reflector::{Reflector, Reflectable, reflect_dom_object};
use dom::bluetooth::Bluetooth;
+use dom::mimetypearray::MimeTypeArray;
use dom::navigatorinfo;
+use dom::pluginarray::PluginArray;
use dom::window::Window;
use util::str::DOMString;
@@ -16,6 +18,8 @@ use util::str::DOMString;
pub struct Navigator {
reflector_: Reflector,
bluetooth: MutNullableHeap<JS<Bluetooth>>,
+ plugins: MutNullableHeap<JS<PluginArray>>,
+ mime_types: MutNullableHeap<JS<MimeTypeArray>>,
}
impl Navigator {
@@ -23,6 +27,8 @@ impl Navigator {
Navigator {
reflector_: Reflector::new(),
bluetooth: Default::default(),
+ plugins: Default::default(),
+ mime_types: Default::default(),
}
}
@@ -78,4 +84,19 @@ impl NavigatorMethods for Navigator {
fn Language(&self) -> DOMString {
navigatorinfo::Language()
}
+
+ // https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
+ fn Plugins(&self) -> Root<PluginArray> {
+ self.plugins.or_init(|| PluginArray::new(self.global().r()))
+ }
+
+ // https://html.spec.whatwg.org/multipage/#dom-navigator-mimetypes
+ fn MimeTypes(&self) -> Root<MimeTypeArray> {
+ self.mime_types.or_init(|| MimeTypeArray::new(self.global().r()))
+ }
+
+ // https://html.spec.whatwg.org/multipage/#dom-navigator-javaenabled
+ fn JavaEnabled(&self) -> bool {
+ false
+ }
}