New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 5 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Jun 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Task



Sign in to add a comment

Sensors API replacing DeviceMotionEvent and DeviceOrientationEvent interfaces

Project Member Reported by mikhail....@intel.com, Jul 28 2017

Issue description

Change description:

The Generic Sensors API is a framework for adding sensor devices to the web platform in a consistent way.
This issue is tracking launch of the following concrete sensor classes which are replacements for the DeviceMotionEvent and DeviceOrientationEvent interfaces:
- Accelerometer
- LinearAccelerationSensor
- Gyroscope
- AbsoluteOrientationSensor
- RelativeOrientationSensor

Changes to API surface:

Old way:

window.addEventListener('devicemotion', event => {
  console.log(event.acceleration.x + ' m/s2');
});

New way:

let sensor = new Accelerometer();
sensor.start();

sensor.onreading = () => {
  console.log(sensor.x + ' m/s2');
}

sensor.onerror = event => console.log(event.error.name, event.error.message);

Links:

https://w3c.github.io/sensors/
https://w3c.github.io/accelerometer/
https://w3c.github.io/gyroscope/
https://w3c.github.io/orientation-sensor

Support in other browsers:
Internet Explorer: No signals
Firefox: No signals
Safari: No signals


 
Cc: rijubrat...@intel.com alexis.m...@intel.com
Cc: juncai@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ef5974549da8fb92738b689372a6bf35f13156ca

commit ef5974549da8fb92738b689372a6bf35f13156ca
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Aug 31 04:52:55 2017

Prepare Generic Sensor bindings for Origin Trial

Link to Intent-to-Experiment thread:

https: //groups.google.com/a/chromium.org/forum/#!topic/blink-dev/2zPZt3watBk
Bug:  750018 
Change-Id: I6eae53ef4e33e0fec613dd0c3a79458810cca1c6
Reviewed-on: https://chromium-review.googlesource.com/643405
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Cr-Commit-Position: refs/heads/master@{#498754}
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/Gyroscope.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/OrientationSensor.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/Sensor.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl
[modify] https://crrev.com/ef5974549da8fb92738b689372a6bf35f13156ca/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5

Comment 4 by owe...@chromium.org, Sep 12 2017

Labels: migrated-launch-owp Type-Task
This issue has been automatically relabelled type=task because type=launch-owp issues are now officially deprecated. The deprecation is because they were creating confusion about how to get launch approvals, which should be instead done via type=launch issues.

We recommend this issue be used for implementation tracking (for public visibility), but if you already have an issue for that, you may mark this as duplicate.

For more details see here: https://docs.google.com/document/d/1JA6RohjtZQc26bTrGoIE_bSXGXUDQz8vc6G0n_sZJ2o/edit

For any questions, please contact owencm, sshruthi, larforge
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 27 2017

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/911b0e2762296769afe578a68607a56ce341317a

commit 911b0e2762296769afe578a68607a56ce341317a
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Oct 06 17:40:23 2017

[sensors] Sensors permissions integration into Origin Trial.

Make calls like 'navigator.permissions.query({ name: "accelerometer" })'
available for sites experimenting with the Generic Sensor API.

Also this patch includes a layout test verifying that the necessary
interfaces and properties are exposed in Origin-Trial enabled document.

Bug:  750018 
Change-Id: I5c753fcd7388b5ed96f481d5e6188c771536ba12
Reviewed-on: https://chromium-review.googlesource.com/672404
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Cr-Commit-Position: refs/heads/master@{#507114}
[add] https://crrev.com/911b0e2762296769afe578a68607a56ce341317a/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/genericsensor-origin-trial-interfaces.html
[modify] https://crrev.com/911b0e2762296769afe578a68607a56ce341317a/third_party/WebKit/Source/modules/permissions/Permissions.cpp

Comment 7 by jmedley@google.com, Nov 8 2017

It looks like the individual interfaces are in separate tracking bugs. For example: https://bugs.chromium.org/p/chromium/issues/detail?id=661478&desc=3

Can someone post tracking bugs for the others?

Thanks,
DevRel Joe
Cc: -scheib@chromium.org
Project Member

Comment 10 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/16bb41404ce82ba7983bf576f0ebefda87de8ece

commit 16bb41404ce82ba7983bf576f0ebefda87de8ece
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Wed Feb 07 10:28:31 2018

[sensors] Screen coordinates synchronization in Accelerometer

This patch introduces construction options for the screen coordinates
synchronization in the Accelerometer and LinearAccelerationSensor classes.

Specification: https://w3c.github.io/accelerometer/#the-spatialsensoroptions-dictionary

Bug:  750018 
Change-Id: I9b402e6d65a77ba624a8c086b9f7c7d2c0a9802e
Reviewed-on: https://chromium-review.googlesource.com/902242
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Reviewed-by: Alexander Shalamov <alexander.shalamov@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534975}
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Accelerometer.h
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/BUILD.gn
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.h
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Sensor.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/Sensor.h
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/SensorProxy.h
[add] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/SensorReadingRemapper.cpp
[add] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/SensorReadingRemapper.h
[add] https://crrev.com/16bb41404ce82ba7983bf576f0ebefda87de8ece/third_party/WebKit/Source/modules/sensor/SpatialSensorOptions.idl

Project Member

Comment 11 by bugdroid1@chromium.org, Feb 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8cce9c2d03c3e7f419a8fabe29018f823e933b93

commit 8cce9c2d03c3e7f419a8fabe29018f823e933b93
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Mon Feb 12 15:59:30 2018

[Sensor]Enable screen coordinates for Gyroscope and Magnetometer

This patch introduces construction options for the screen coordinates
synchronization in the Gyroscope and Magnetometer classes, accordingly
to [1] and [2]

[1]https://w3c.github.io/gyroscope/#construct-a-gyroscope-object
[2]https://w3c.github.io/magnetometer/#construct-a-magnetometer-object

Bug:  750018 
Change-Id: I954dd56d9471d96470a3851b755a95d7182a7388
Reviewed-on: https://chromium-review.googlesource.com/907556
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Alexander Shalamov <alexander.shalamov@intel.com>
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Cr-Commit-Position: refs/heads/master@{#536083}
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/Gyroscope.h
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/Gyroscope.idl
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/Magnetometer.h
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/Magnetometer.idl
[modify] https://crrev.com/8cce9c2d03c3e7f419a8fabe29018f823e933b93/third_party/WebKit/Source/modules/sensor/SensorReadingRemapper.cpp

Project Member

Comment 12 by bugdroid1@chromium.org, Feb 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/001287864d99f3e14b073c0215bce270f43c13ca

commit 001287864d99f3e14b073c0215bce270f43c13ca
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Thu Feb 15 15:34:51 2018

[Sensor]Enable screen coordinates for orientation sensors

This patch introduces construction options for the screen coordinates
synchronization in the Absolute- and RelativeOrientationSensor classes,
accordingly to [1].

[1]https://w3c.github.io/orientation-sensor/#construct-an-orientation-sensor-object

Bug:  750018 
Change-Id: Ic24952220b7cb4a56058d143afddecc85a04ed50
Reviewed-on: https://chromium-review.googlesource.com/913389
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Reviewed-by: Alexander Shalamov <alexander.shalamov@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537022}
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.cpp
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.h
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/OrientationSensor.h
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.cpp
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.h
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl
[modify] https://crrev.com/001287864d99f3e14b073c0215bce270f43c13ca/third_party/WebKit/Source/modules/sensor/SensorReadingRemapper.cpp

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/201c8e48ae8a1ede1526e9137e913206be71ef0b

commit 201c8e48ae8a1ede1526e9137e913206be71ef0b
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Apr 06 15:30:43 2018

[sensor] Fix origin in SensorProviderProxyImpl::CheckPermission()

Origin must be extracted from the URL before it is passed to
GetPermissionStatusForFrame().

Bug:  750018 
Change-Id: Iffffbf4ec516cb1a798c3604333a71d3bdac5e9e
Reviewed-on: https://chromium-review.googlesource.com/998160
Reviewed-by: Alexander Shalamov <alexander.shalamov@intel.com>
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Cr-Commit-Position: refs/heads/master@{#548781}
[modify] https://crrev.com/201c8e48ae8a1ede1526e9137e913206be71ef0b/content/browser/generic_sensor/sensor_provider_proxy_impl.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Apr 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b90312615c24b59834bfbb2f648bf1e3e9187065

commit b90312615c24b59834bfbb2f648bf1e3e9187065
Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Date: Fri Apr 06 17:20:11 2018

Ship Generic Sensors-based motion sensors

This patch enables by default the following interfaces:
Accelerometer, LinearAccelerationSensor, Gyroscope, AbsoluteOrientationSensor and RelativeOrientationSensor.

Intent-To-Ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/r8iKkTXftm4

Bug:  750018 
Change-Id: Id92b54ca01e254d177760a42a022df45403f5f37
Reviewed-on: https://chromium-review.googlesource.com/997852
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Cr-Commit-Position: refs/heads/master@{#548833}
[modify] https://crrev.com/b90312615c24b59834bfbb2f648bf1e3e9187065/services/device/public/cpp/device_features.cc
[modify] https://crrev.com/b90312615c24b59834bfbb2f648bf1e3e9187065/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt

Labels: -M-62 M-67
Project Member

Comment 16 by sheriffbot@chromium.org, Jun 1

Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Started)
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
Status: Fixed (was: Untriaged)
Chrome 67 is rolling out to stable channel. Closing this issue.
Project Member

Comment 18 by bugdroid1@chromium.org, Jul 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6792dda697b70e2704671f518450f59fb9ddd3a5

commit 6792dda697b70e2704671f518450f59fb9ddd3a5
Author: Reilly Grant <reillyg@chromium.org>
Date: Mon Jul 09 17:10:19 2018

Mark Generic Sensors API "stable"

The Generic Sensors API has already been shipped however in
runtime_enabled_features.json5 it was still set to "experimental"
because it was shipped by setting the default value of the
device::kGenericSensors flag to enabled. This change reflects that in
Blink and reverses the logic in runtime_features.cc so that disabling
the Chrome flag will disable the Blink flag.

Bug:  750018 
Change-Id: If11794bc915f6e73e82c55efcda50c5f58859a0a
Reviewed-on: https://chromium-review.googlesource.com/1128396
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573342}
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/content/child/runtime_features.cc
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/permissions/permissions.cc
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/absolute_orientation_sensor.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/accelerometer.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/gyroscope.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/linear_acceleration_sensor.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/orientation_sensor.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/relative_orientation_sensor.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/sensor.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/modules/sensor/sensor_error_event.idl
[modify] https://crrev.com/6792dda697b70e2704671f518450f59fb9ddd3a5/third_party/blink/renderer/platform/runtime_enabled_features.json5

Sign in to add a comment