Auto merge of #23551 - asajeffrey:script-navigatorid, r=jdm

Added missing NavigatorId attributes

<!-- Please describe your changes on the following line: -->

Add the missing attributes from https://html.spec.whatwg.org/multipage/system-state.html#navigatorid

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because there are already tests for Navigator

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23551)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-06-12 16:59:31 -04:00 committed by GitHub
commit a74f38f843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 81 additions and 36 deletions

View file

@ -66,6 +66,21 @@ impl NavigatorMethods for Navigator {
navigatorinfo::Product() 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 // https://html.spec.whatwg.org/multipage/#dom-navigator-taintenabled
fn TaintEnabled(&self) -> bool { fn TaintEnabled(&self) -> bool {
navigatorinfo::TaintEnabled() navigatorinfo::TaintEnabled()

View file

@ -9,6 +9,18 @@ pub fn Product() -> DOMString {
DOMString::from("Gecko") 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 { pub fn TaintEnabled() -> bool {
false false
} }

View file

@ -22,8 +22,11 @@ interface NavigatorID {
readonly attribute DOMString appVersion; readonly attribute DOMString appVersion;
readonly attribute DOMString platform; readonly attribute DOMString platform;
readonly attribute DOMString product; // constant "Gecko" readonly attribute DOMString product; // constant "Gecko"
[Exposed=Window] readonly attribute DOMString productSub;
boolean taintEnabled(); // constant false boolean taintEnabled(); // constant false
readonly attribute DOMString userAgent; 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 // https://webbluetoothcg.github.io/web-bluetooth/#navigator-extensions

View file

@ -42,6 +42,21 @@ impl WorkerNavigatorMethods for WorkerNavigator {
navigatorinfo::Product() 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 // https://html.spec.whatwg.org/multipage/#dom-navigator-taintenabled
fn TaintEnabled(&self) -> bool { fn TaintEnabled(&self) -> bool {
navigatorinfo::TaintEnabled() navigatorinfo::TaintEnabled()

View file

@ -4976,15 +4976,6 @@
[PromiseRejectionEvent interface: attribute promise] [PromiseRejectionEvent interface: attribute promise]
expected: FAIL expected: FAIL
[Navigator interface: attribute productSub]
expected: FAIL
[Navigator interface: attribute vendor]
expected: FAIL
[Navigator interface: attribute vendorSub]
expected: FAIL
[Navigator interface: attribute oscpu] [Navigator interface: attribute oscpu]
expected: FAIL expected: FAIL
@ -5003,15 +4994,6 @@
[Navigator interface: attribute hardwareConcurrency] [Navigator interface: attribute hardwareConcurrency]
expected: FAIL expected: FAIL
[Navigator interface: window.navigator must inherit property "productSub" with the proper type]
expected: FAIL
[Navigator interface: window.navigator must inherit property "vendor" with the proper type]
expected: FAIL
[Navigator interface: window.navigator must inherit property "vendorSub" with the proper type]
expected: FAIL
[Navigator interface: window.navigator must inherit property "oscpu" with the proper type] [Navigator interface: window.navigator must inherit property "oscpu" with the proper type]
expected: FAIL expected: FAIL
@ -10049,15 +10031,6 @@
[PromiseRejectionEvent interface: attribute promise] [PromiseRejectionEvent interface: attribute promise]
expected: FAIL expected: FAIL
[Navigator interface: attribute productSub]
expected: FAIL
[Navigator interface: attribute vendor]
expected: FAIL
[Navigator interface: attribute vendorSub]
expected: FAIL
[Navigator interface: attribute oscpu] [Navigator interface: attribute oscpu]
expected: FAIL expected: FAIL
@ -10076,15 +10049,6 @@
[Navigator interface: attribute hardwareConcurrency] [Navigator interface: attribute hardwareConcurrency]
expected: FAIL expected: FAIL
[Navigator interface: window.navigator must inherit property "productSub" with the proper type]
expected: FAIL
[Navigator interface: window.navigator must inherit property "vendor" with the proper type]
expected: FAIL
[Navigator interface: window.navigator must inherit property "vendorSub" with the proper type]
expected: FAIL
[Navigator interface: window.navigator must inherit property "oscpu" with the proper type] [Navigator interface: window.navigator must inherit property "oscpu" with the proper type]
expected: FAIL expected: FAIL

View file

@ -630,6 +630,24 @@
[WorkerNavigator interface: self.navigator must not have property "taintEnabled"] [WorkerNavigator interface: self.navigator must not have property "taintEnabled"]
expected: FAIL expected: FAIL
[WorkerNavigator interface: self.navigator must not have property "vendor"]
expected: FAIL
[WorkerNavigator interface: self.navigator must not have property "vendorSub"]
expected: FAIL
[WorkerNavigator interface: self.navigator must not have property "productSub"]
expected: FAIL
[WorkerNavigator interface: member vendor]
expected: FAIL
[WorkerNavigator interface: member vendorSub]
expected: FAIL
[WorkerNavigator interface: member productSub]
expected: FAIL
[OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, boolean)] [OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, boolean)]
expected: FAIL expected: FAIL

View file

@ -30,6 +30,24 @@
[WorkerNavigator interface: attribute onLine] [WorkerNavigator interface: attribute onLine]
expected: FAIL expected: FAIL
[WorkerNavigator interface: member productSub]
expected: FAIL
[WorkerNavigator interface: member vendor]
expected: FAIL
[WorkerNavigator interface: member vendorSub]
expected: FAIL
[WorkerNavigator interface: self.navigator must not have property "productSub"]
expected: FAIL
[WorkerNavigator interface: self.navigator must not have property "vendor"]
expected: FAIL
[WorkerNavigator interface: self.navigator must not have property "vendorSub"]
expected: FAIL
[WorkerNavigator interface: self.navigator must inherit property "languages" with the proper type (7)] [WorkerNavigator interface: self.navigator must inherit property "languages" with the proper type (7)]
expected: FAIL expected: FAIL