/
656.txt
118 lines (90 loc) · 4.94 KB
/
656.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
* 仕様書
[REFS[
- [9] [CITE@en[DeviceOrientation Event Specification]] ([TIME[2016-08-19 00:30:43 +09:00]]) <https://w3c.github.io/deviceorientation/spec-source-orientation.html>
-- [11] [CITE@en[DeviceOrientation Event Specification]] ([TIME[2016-08-19 00:30:43 +09:00]]) <https://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientation>
]REFS]
* イベント
[10]
[FIG(short list)[
- [CODE(DOMe)@en[deviceorientation]]
- [CODE(DOMe)@en[devicemotion]]
- [CODE(DOMe)@en[compassneedscalibration]]
]FIG]
[15] [CODE(DOMi)@en[Window]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[ondeviceorientation]]]] [[IDL属性]]は、
[CODE(DOMe)@en[deviceorientation]] [[イベント]]の[[イベントハンドラーIDL属性]]です
[SRC[>>11]]。
* [CODE(DOMi)@en[DeviceOrientationEvent]] インターフェイス
[17] [DFN[[CODE(DOMi)@en[DeviceOrientationEvent]]]] [[インターフェイス]]は、
[CODE(DOMi)@en[Event]] [[インターフェイス]]を[[継承]]しています。
[[文書環境]]に[[晒され]]ています。
[DFN[[CODE(DOMi)@en[DeviceOrientationEventInit]]]] [[辞書]]は、
[CODE(DOMi)@en[EventInit]] [[辞書]]を[[継承]]しています。 [SRC[>>11]]
[18] 両者は、次の[[IDL属性]]/[[辞書メンバー]]を持ちます。
[FIG(short list)[
- [CODE(DOMa)@en[alpha]]
- [CODE(DOMa)@en[beta]]
- [CODE(DOMa)@en[gamma]]
- [CODE(DOMa)@en[absolute]]
]FIG]
[19] [DFN[[CODE(DOMa)@en[alpha]]]], [DFN[[CODE(DOMa)@en[beta]]]],
[DFN[[CODE(DOMa)@en[gamma]]]] は、 [CODE(IDL)@en[[[long]][[?][nullable]]]] 型であり、
[[辞書]]における既定値は [CODE[null]] です。 [SRC[>>11]]
[20] [DFN[[CODE[absolute]]]] は、 [CODE(IDL)@en[boolean]] 型であり、
[[辞書]]における既定値は[[偽]]です。 [SRC[>>11]]
* 処理
[12] [[DeviceOrientation Event]] に対応する[[利用者エージェント]]は、
[[装置]]の[RUBYB[方向]@en[orientation]]が変化した時、これを通知しなければ[MUST[なりません]]。
方向が[RUBYB[大きく]@en[significant]]変化した時に通知する[SHOULD[べきです]]。
「大き」いとする基準は[[実装]]依存ですが、1°の変更を最大の[[閾値]]とする[SHOULD[べきです]]。
加えて、[[Webページ]]が十分新しいデータを持っていないと判断できるときにも、
通知できます。 [SRC[>>11]]
[21] 次のようにしなければ[MUST[なりません]] [SRC[>>11]]。
[FIG(steps)[
= [22] [VAR[α]]、[VAR[β]]、[VAR[γ]]を、
[[装置]]の方向を[[地球座標枠]]から[[装置座標枠]]への[RUBYB[[[変形]]]@en[transformation]]として表したものに設定します。
= [14]
@@ [VAR[窓]]を、 [CODE(DOMi)@en[Window]] に設定します。
= [13] [[イベントを発火]]します。
[FIG(list members)[
: [VAR[[[インターフェイス][イベントインターフェイス]]]] : [CODE(DOMi)@en[DeviceOrientationEvent]]
: [VAR[[[名前][イベント型]]]] : [DFN[[CODE(DOMe)@en[deviceorientation]]]]
: [VAR[[[対象][イベント対象]]]] : [VAR[窓]]
: [CODE(DOMa)@en[alpha]] : [VAR[α]]
: [CODE(DOMa)@en[beta]] : [VAR[β]]
: [CODE(DOMa)@en[gamma]] : [VAR[γ]]
]FIG]
]FIG]
* 歴史
[1] [CITE@en[DeviceOrientation Event Specification]]
( ([TIME[2011-06-28 16:41:24 +09:00]] 版))
<http://www.w3.org/TR/2011/WD-orientation-event-20110628/>
[2] [CITE@en[DeviceOrientation Event Specification]]
( ([TIME[2011-12-01 22:34:51 +09:00]] 版))
<http://www.w3.org/TR/2011/WD-orientation-event-20111201/>
[3] [CITE@en[DeviceOrientation Event Specification]]
( ([TIME[2012-06-14 06:21:37 +09:00]] 版))
<http://dev.w3.org/geo/api/spec-source-orientation.html>
[FIG(quote)[
[FIGCAPTION[
[4] [CITE[Intent to deprecate: Insecure usage of powerful features - Google グループ]]
([TIME[2015-02-28 11:14:59 +09:00]] 版)
<https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/2LXKVWYkOus>
]FIGCAPTION]
> 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.
]FIG]
[5] [CITE@en[DeviceOrientation Event Specification]]
([TIME[2014-08-28 19:28:23 +09:00]] 版)
<http://w3c.github.io/deviceorientation/spec-source-orientation.html>
[6] [CITE@en[DeviceOrientation: next steps?]]
([[Mandyam, Giridhar]] 著, [TIME[2015-07-07 09:08:51 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-geolocation/2015Jul/0003.html>
[7] [CITE@en-us[Detecting device orientation - MDC]]
([TIME[2010-01-21 13:30:20 +09:00]] 版)
<https://developer.mozilla.org/en/Detecting_device_orientation>
[8] [CITE@en[DeviceOrientation Event Specification]]
([TIME[2016-08-18 00:27:48 +09:00]])
<https://www.w3.org/TR/2016/CR-orientation-event-20160818/>
[16] [CITE@en[w3c/deviceorientation: W3C Device Orientation spec]]
([TIME[2016-10-30 21:03:22 +09:00]])
<https://github.com/w3c/deviceorientation>