DeviceMotionEvent

DeviceMotionEvent

仕様書

イベントハンドラー

[5] Window インターフェイスの ondevicemotion IDL属性は、 devicemotion イベントのイベントハンドラーIDL属性です >>4。

DeviceMotionEvent インターフェイス

[9] DeviceMotionEvent インターフェイスは、 Event インターフェイスを継承しています。 イベント構築子を持ちます。 文書環境に晒されています。 DeviceMotionEventInit 辞書は、 EventInit 辞書を継承しています。 >>4

[10] 両者は、次のIDL属性/辞書メンバーを持ちます。

n
名前
attr
IDL属性の型
dict
辞書メンバーの型
init
初期値
n
acceleration
attr
DeviceAcceleration?
dict
DeviceAccelerationInit?
init
null
n
accelerationIncludingGravity
attr
DeviceAcceleration?
dict
DeviceAccelerationInit?
init
null
n
rotationRate
attr
DeviceRotationRate?
dict
DeviceRotationRateInit?
init
null
n
interval
attr
double?
dict
double?
init
null

処理

[19] DeviceOrientation Event に対応した利用者エージェントは、 devicemotion イベントを発火しなければなりません。 情報を提供できない場合も、 (null で) 発火するべきです。 >>4

[18] 取得間隔を、固定の ms 単位の値に設定します。 取得間隔ごとに、ハードウェアからデータを取得します。 動きの情報を提供できないときは、 取得間隔を null に設定します。 >>4

[8] 窓の決定、取得間隔の決定、そもそもこの情報を提供するかどうかなどについては、 DeviceOrientation Event を参照。

[6] 次のようにしなければなりません >>4。

  1. [11] 加速度を、null に設定します。
  2. [12] 重力入り加速度を、 null に設定します。
  3. [14] 測定値を、 装置の地球座標枠に対する加速度を、 本体枠によって表現したもの (単位は m/s2) に設定します。 取得できない場合は、 null に設定します。
  4. [13] 重力の影響を排した加速度を得られない場合 (ジャイロスコープの無い場合など) は、
    1. [15] 重力入り加速度を、 測定値に設定します。
  5. [16] それ以外の場合、
    1. [17] 加速度を、測定値に設定します。
  6. [7] イベントを発火します。
    名前
    devicemotion
    インターフェイス
    DeviceMotionEvent
    対象
    窓
    acceleration
    加速度
    accelerationIncludingGravity
    重力入り加速度
    rotationRate
    装置の空間中の回転率を、 装置の方向の角度の変化率 (単位 °/s) で表したもの。 取得できない場合は、 null に設定します。
    interval
    取得間隔


[22] Windows 版の Chrome の、おそらく測定できない環境では、 acceleration、accelerationIncludingGravity、 rotationRate ともオブジェクトになりますが、 各IDL属性は null になります。 interval は 0 になります。

セキュリティー

[21] fingerprinting vector です >>20。

歴史

[1] DeviceOrientation Event Specification ( ( 版)) http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion

[2] devicemotion - Event reference | MDN ( ( 版)) https://developer.mozilla.org/en-US/docs/Web/Events/devicemotion

[3] Intent to deprecate: Insecure usage of powerful features - Google グループ ( 版) https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/2LXKVWYkOus

We want to start applying the concepts in https://w3c.github.io/webappsec/specs/powerfulfeatures/ to features that have already shipped and which do not meet the (new, not present at the time) requirements.

[23] Merge pull request #41 from w3c/timvolodine-clarify-null (timvolodine著, ) https://github.com/w3c/deviceorientation/commit/e37c9f2df202bc4958c4448e95814d77858a15bf

[24] Deprecations and Removals in Chrome 59  |  Web  |  Google Developers () https://developers.google.com/web/updates/2017/04/chrome-59-deprecations

[25] Safari 12.1 Release Notes | Apple Developer Documentation () https://developer.apple.com/documentation/safari_release_notes/safari_12_1_release_notes

Added Motion & Orientation settings on iOS to enable the DeviceMotionEvent and DeviceOrientationEvent events.