Navigation Menu

Skip to content

Commit

Permalink
Added missing NavigatorId attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jun 11, 2019
1 parent b3eed5b commit 4cfd62a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions components/script/dom/navigator.rs
Expand Up @@ -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()
Expand Down
12 changes: 12 additions & 0 deletions components/script/dom/navigatorinfo.rs
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions components/script/dom/webidls/Navigator.webidl
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions components/script/dom/workernavigator.rs
Expand Up @@ -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()
Expand Down

0 comments on commit 4cfd62a

Please sign in to comment.