DeviceOrientationEvent

DeviceOrientationEvent

仕様書

イベント

[10] 次のイベントがあります。

[15] Window インターフェイスondeviceorientation IDL属性は、 deviceorientation イベントイベントハンドラーIDL属性です >>11

[37] Window インターフェイスondeviceorientationabsolute IDL属性は、 deviceorientationabsolute イベントイベントハンドラーIDL属性です >>36

DeviceOrientationEvent インターフェイス

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

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

処理

イベントの発火

[12] DeviceOrientation Event に対応する利用者エージェントは、

[14] 頻度と対象となるについては、 >>24 を参照。

[38] deviceorientationdeviceorientationabsolute の2つのイベント型について発火しなければなりません >>11, >>36

[21] におけるイベント型発火は次のようにしなければなりません >>11

  1. [22] αβγ絶対イベント型に関する装置の方向に設定します。
  2. [13] イベントを発火します。
    インターフェイス
    DeviceOrientationEvent
    名前
    イベント型
    対象
    alpha
    α
    beta
    β
    gamma
    γ
    absolute
    絶対

[23] イベント型deviceorientationdeviceorientationabsolute かは、装置の方向の測定に用いる装置の違い (によって得られる値の違い) となっています。

発火対象と頻度

[24] deviceorientation, deviceorientationabsolute, devicemotionイベントは、利用者エージェントの定めた頻度間隔で、 利用者エージェントの定めた Window において発火されます。

[25] 具体的な条件は、なぜか規定されていません。 それを規定しないことには相互運用性が保てないと思うのですが...

[26] 仕様書は、参考ながら、 fingerprinting のリスクの軽減と省電力のため、 次のようにするのが良いと提示しています >>19

[35] 見えるかどうかと Page Visibility との関係は明らかではありません。

[33] スクリプトからは直接観察できませんが、実装上、 イベントリスナーが登録されている場合のみ測定に必要な装置を動作させるようにするのが普通と考えられます。


[34] WindowsChrome で、おそらく測定できない環境では、 deviceorientation, deviceorientationabsolutedevicemotion とも、 addEventListener した直後に一度発火されます。 (おそらくその後は発火されません。) alphabetagamma とも null になります。 どちらのイベント型でも、 absoluteになります。

セキュリティー

[20] fingerprinting vector と考える人もいます >>19

歴史

[1] DeviceOrientation Event Specification ( ( 版)) <http://www.w3.org/TR/2011/WD-orientation-event-20110628/>

[2] DeviceOrientation Event Specification ( ( 版)) <http://www.w3.org/TR/2011/WD-orientation-event-20111201/>

[3] DeviceOrientation Event Specification ( ( 版)) <http://dev.w3.org/geo/api/spec-source-orientation.html>

[4] 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.

[5] DeviceOrientation Event Specification ( 版) <http://w3c.github.io/deviceorientation/spec-source-orientation.html>

[6] DeviceOrientation: next steps? (Mandyam, Giridhar 著, 版) <https://lists.w3.org/Archives/Public/public-geolocation/2015Jul/0003.html>

[7] Detecting device orientation - MDC ( 版) <https://developer.mozilla.org/en/Detecting_device_orientation>

[8] DeviceOrientation Event Specification () <https://www.w3.org/TR/2016/CR-orientation-event-20160818/>

[16] w3c/deviceorientation: W3C Device Orientation spec () <https://github.com/w3c/deviceorientation>

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