[Sensor] Feature detection |
||||
Issue descriptionThe Sensor constructor must throw if an unsupported option is passed there, so that client code can verify that the returned sensor data will correspond to what is required from the SensorOptions. ED specification: https://w3c.github.io/sensors/#initialize-a-sensor-object WPT test: https://github.com/w3c/web-platform-tests/blob/master/sensors/generic-sensor-tests.js#L260 This behavior differs from normal bindings generator in Chromium which just ignores all the unused dictionary entries.
,
Mar 20 2018
My understanding is that "an ordered map with string keys" doesn't mean an ECMAScript value. IDL Record value is an example of "ordered map (with string keys)". https://heycam.github.io/webidl/#idl-record An ECMAScript value is NOT IMPLICITLY treated as a IDL dictionary type value. It's explicitly converted to an IDL dictionary type value. The conversion steps are exactly defined at: https://heycam.github.io/webidl/#es-dictionary Following the steps, extra properties of the ECMAScript value is just ignored. Plus, in this conversion algorithm, there is no need for the ECMAScript value to have an own property with a specific key name. A value of a dictionary member is extracted via [[Get]]. https://tc39.github.io/ecma262/#sec-get-o-p So, the following |proxy| can work as an IDL dictionary which only requires numeric dictionary members. let handler = { get: function(target, name) { return 42; } }; let proxy = new Proxy({}, handler); |proxy['any_key']| always returns 42. So, all dictionary members' values will be 42 with this |proxy|. Probably this is not what you imagine, but Web IDL and ECMAScript are defined in this way.
,
Mar 20 2018
It seems to be a known issue in Web IDL https://github.com/heycam/webidl/issues/107 So far, we have no good ways to detect if any unexpected entries are present in the given ECMAScript object. At the moment, feature detection works in the Generic Sensor API for existing options (the already specified ones). The planned new sensor options will be added only after https://github.com/heycam/webidl/issues/107 is fixed.
,
Mar 20 2018
Is there a Generic Sensors spec issue we can mark as blocked on WebIDL issue?
,
Mar 21 2018
,
Mar 21 2018
Issue 823636 has been merged into this issue.
,
Jun 1 2018
The assigned owner "mikhail.pozdnyakov@intel.com" is not able to receive e-mails, please re-triage. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 13 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by reillyg@chromium.org
, Mar 19 2018