author | autofoolip <auto@foolip.org> |
Fri, 07 Aug 2020 12:41:26 +0000 | |
changeset 544793 | df7ff815890fcb786fc82d9e23e39cf23a66e7a5 |
parent 544792 | 8cc8d3fd89e8162ee933e1224b971110b910aa98 |
child 544794 | 52fefc76d908c71a00085be4a913607fe0eeba6b |
push id | 37701 |
push user | rmaries@mozilla.com |
push date | Sat, 15 Aug 2020 21:17:39 +0000 |
treeherder | mozilla-central@ffc01c0f13a8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | testonly |
bugs | 1656635, 24839 |
milestone | 81.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/testing/web-platform/tests/interfaces/webhid.idl +++ b/testing/web-platform/tests/interfaces/webhid.idl @@ -9,17 +9,20 @@ dictionary HIDDeviceFilter { unsigned short usagePage; unsigned short usage; }; dictionary HIDDeviceRequestOptions { required sequence<HIDDeviceFilter> filters; }; -[SecureContext] +[ + Exposed=Window, + SecureContext +] interface HID : EventTarget { attribute EventHandler onconnect; attribute EventHandler ondisconnect; Promise<sequence<HIDDevice>> getDevices(); Promise<sequence<HIDDevice>> requestDevice( HIDDeviceRequestOptions options); }; @@ -27,86 +30,108 @@ interface HID : EventTarget { [SameObject] readonly attribute HID hid; }; dictionary HIDConnectionEventInit : EventInit { required HIDDevice device; }; [ - Constructor(DOMString type, HIDConnectionEventInit eventInitDict), + Exposed=Window, SecureContext ] interface HIDConnectionEvent : Event { + constructor(DOMString type, HIDConnectionEventInit eventInitDict); [SameObject] readonly attribute HIDDevice device; }; dictionary HIDInputReportEventInit : EventInit { required HIDDevice device; required octet reportId; required DataView data; }; [ - Constructor(DOMString type, HIDInputReportEventInit eventInitDict), + Exposed=Window, SecureContext ] interface HIDInputReportEvent : Event { + constructor(DOMString type, HIDInputReportEventInit eventInitDict); [SameObject] readonly attribute HIDDevice device; readonly attribute octet reportId; readonly attribute DataView data; }; enum HIDUnitSystem { "none", "si-linear", "si-rotation", "english-linear", "english-rotation", "vendor-defined", "reserved" }; -[SecureContext] interface HIDReportItem { +[ + Exposed=Window, + SecureContext +] interface HIDReportItem { readonly attribute boolean isAbsolute; readonly attribute boolean isArray; readonly attribute boolean isRange; readonly attribute boolean hasNull; readonly attribute FrozenArray<unsigned long> usages; readonly attribute unsigned long usageMinimum; readonly attribute unsigned long usageMaximum; + readonly attribute unsigned long designatorMinimum; + readonly attribute unsigned long designatorMaximum; + readonly attribute unsigned long stringMinimum; + readonly attribute unsigned long stringMaximum; readonly attribute unsigned short reportSize; readonly attribute unsigned short reportCount; - readonly attribute unsigned long unitExponent; - readonly attribute HIDUnitSystem unitSystem; - readonly attribute byte unitFactorLengthExponent; - readonly attribute byte unitFactorMassExponent; - readonly attribute byte unitFactorTimeExponent; - readonly attribute byte unitFactorTemperatureExponent; - readonly attribute byte unitFactorCurrentExponent; - readonly attribute byte unitFactorLuminousIntensityExponent; + readonly attribute byte unitExponent; + readonly attribute unsigned long unit; readonly attribute long logicalMinimum; readonly attribute long logicalMaximum; readonly attribute long physicalMinimum; readonly attribute long physicalMaximum; - readonly attribute FrozenArray<DOMString> strings; }; -[SecureContext] interface HIDReportInfo { +[ + Exposed=Window, + SecureContext +] interface HIDReportInfo { readonly attribute octet reportId; readonly attribute FrozenArray<HIDReportItem> items; }; -[SecureContext] interface HIDCollectionInfo { +dictionary HIDFieldOptions { + required octet reportId; + required unsigned long fieldIndex; + boolean isFeatureReport; +}; + +[ + Exposed=Window, + SecureContext +] interface HIDCollectionInfo { readonly attribute unsigned short usagePage; readonly attribute unsigned short usage; readonly attribute FrozenArray<HIDCollectionInfo> children; readonly attribute FrozenArray<HIDReportInfo> inputReports; readonly attribute FrozenArray<HIDReportInfo> outputReports; readonly attribute FrozenArray<HIDReportInfo> featureReports; + readonly attribute FrozenArray<octet> reportIds; + + double getField(BufferSource reportData, HIDFieldOptions options); + void setField(BufferSource reportData, HIDFieldOptions options, + double value); }; -[SecureContext] interface HIDDevice : EventTarget { +[ + Exposed=Window, + SecureContext +] interface HIDDevice : EventTarget { attribute EventHandler oninputreport; readonly attribute boolean opened; readonly attribute unsigned short vendorId; readonly attribute unsigned short productId; readonly attribute DOMString productName; readonly attribute FrozenArray<HIDCollectionInfo> collections; Promise<void> open(); Promise<void> close(); - Promise<void> sendReport(octet reportId, BufferSource data); - Promise<void> sendFeatureReport(octet reportId, BufferSource data); - Promise<DataView> receiveFeatureReport(octet reportId); + Promise<void> sendReport([EnforceRange] octet reportId, BufferSource data); + Promise<void> sendFeatureReport([EnforceRange] octet reportId, BufferSource data); + Promise<DataView> receiveFeatureReport([EnforceRange] octet reportId); };