Bug 1656635 [wpt PR 24839] - Update interfaces/webhid.idl, a=testonly
☠☠ backed out by a6e9c6ea61f6 ☠ ☠
authorautofoolip <auto@foolip.org>
Fri, 07 Aug 2020 12:41:26 +0000
changeset 543916 326cd6196e29f4efba3e3cecbeb4aed5494466e9
parent 543915 76e363f02fa4b841bf650ec0f2d4d55564c8458a
child 543917 3d3903217e6264b970dd8e10a4cc1bbd31c431e7
push id123742
push userwptsync@mozilla.com
push dateFri, 07 Aug 2020 23:31:06 +0000
treeherderautoland@9584ddf5d03a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1656635, 24839
milestone81.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
Bug 1656635 [wpt PR 24839] - Update interfaces/webhid.idl, a=testonly Automatic update from web-platform-tests Update interfaces/webhid.idl (#24839) Source: https://github.com/tidoust/reffy-reports/blob/9cf26f4/ed/idl/webhid.idl Build: https://travis-ci.org/tidoust/reffy-reports/builds/713880413 -- wpt-commits: 20d739fc7796e07513437caeac9a7e5ce4736e4c wpt-pr: 24839
testing/web-platform/tests/interfaces/webhid.idl
--- 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);
 };