From 4cfd62ac796e4678c21da87688cb4ea0dbfdcf60 Mon Sep 17 00:00:00 2001 From: Alan Jeffrey Date: Tue, 11 Jun 2019 11:46:28 -0500 Subject: [PATCH] Added missing NavigatorId attributes --- components/script/dom/navigator.rs | 15 +++++++++++++++ components/script/dom/navigatorinfo.rs | 12 ++++++++++++ components/script/dom/webidls/Navigator.webidl | 3 +++ components/script/dom/workernavigator.rs | 15 +++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs index d4666ba2aa62..8a5524b437bc 100644 --- a/components/script/dom/navigator.rs +++ b/components/script/dom/navigator.rs @@ -66,6 +66,21 @@ impl NavigatorMethods for Navigator { navigatorinfo::Product() } + // https://html.spec.whatwg.org/multipage/#dom-navigator-productsub + fn ProductSub(&self) -> DOMString { + navigatorinfo::ProductSub() + } + + // https://html.spec.whatwg.org/multipage/#dom-navigator-vendor + fn Vendor(&self) -> DOMString { + navigatorinfo::Vendor() + } + + // https://html.spec.whatwg.org/multipage/#dom-navigator-vendorsub + fn VendorSub(&self) -> DOMString { + navigatorinfo::VendorSub() + } + // https://html.spec.whatwg.org/multipage/#dom-navigator-taintenabled fn TaintEnabled(&self) -> bool { navigatorinfo::TaintEnabled() diff --git a/components/script/dom/navigatorinfo.rs b/components/script/dom/navigatorinfo.rs index 234b75024f3e..117bfce87c10 100644 --- a/components/script/dom/navigatorinfo.rs +++ b/components/script/dom/navigatorinfo.rs @@ -9,6 +9,18 @@ pub fn Product() -> DOMString { DOMString::from("Gecko") } +pub fn ProductSub() -> DOMString { + DOMString::from("20100101") +} + +pub fn Vendor() -> DOMString { + DOMString::from("") +} + +pub fn VendorSub() -> DOMString { + DOMString::from("") +} + pub fn TaintEnabled() -> bool { false } diff --git a/components/script/dom/webidls/Navigator.webidl b/components/script/dom/webidls/Navigator.webidl index 1b4f18640ff2..eb3577159fa6 100644 --- a/components/script/dom/webidls/Navigator.webidl +++ b/components/script/dom/webidls/Navigator.webidl @@ -22,8 +22,11 @@ interface NavigatorID { readonly attribute DOMString appVersion; readonly attribute DOMString platform; readonly attribute DOMString product; // constant "Gecko" + [Exposed=Window] readonly attribute DOMString productSub; boolean taintEnabled(); // constant false readonly attribute DOMString userAgent; + [Exposed=Window] readonly attribute DOMString vendor; + [Exposed=Window] readonly attribute DOMString vendorSub; // constant "" }; // https://webbluetoothcg.github.io/web-bluetooth/#navigator-extensions diff --git a/components/script/dom/workernavigator.rs b/components/script/dom/workernavigator.rs index 9753c85c3bcf..6c4867eda9db 100644 --- a/components/script/dom/workernavigator.rs +++ b/components/script/dom/workernavigator.rs @@ -42,6 +42,21 @@ impl WorkerNavigatorMethods for WorkerNavigator { navigatorinfo::Product() } + // https://html.spec.whatwg.org/multipage/#dom-navigator-productsub + fn ProductSub(&self) -> DOMString { + navigatorinfo::ProductSub() + } + + // https://html.spec.whatwg.org/multipage/#dom-navigator-vendor + fn Vendor(&self) -> DOMString { + navigatorinfo::Vendor() + } + + // https://html.spec.whatwg.org/multipage/#dom-navigator-vendorsub + fn VendorSub(&self) -> DOMString { + navigatorinfo::VendorSub() + } + // https://html.spec.whatwg.org/multipage/#dom-navigator-taintenabled fn TaintEnabled(&self) -> bool { navigatorinfo::TaintEnabled()