-
Notifications
You must be signed in to change notification settings - Fork 4
/
163.txt
143 lines (109 loc) · 7.34 KB
/
163.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
* 仕様書
[REFS[
- [65] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-05-06 10:42:35 +09:00]] 版) <https://html.spec.whatwg.org/#location>
- [68] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-05-06 10:42:35 +09:00]] 版) <https://html.spec.whatwg.org/#allowed-to-show-a-popup>
- [4] [CITE@en-US[Fullscreen API Standard]] ([TIME[2016-07-22 02:49:58 +09:00]]) <https://fullscreen.spec.whatwg.org/#allowed-to-request-fullscreen>
- [9] [CITE@en[The Screen Orientation API]] ([TIME[2016-07-22 04:15:20 +09:00]]) <https://w3c.github.io/screen-orientation/#dfn-triggered-by-a-user-generated-orientation-change>
]REFS]
* user activation
[69] [DFN[triggered by user activation]] (旧 [DFN[[[allowed to show a popup]]]])
とは、次のいずれかの条件を満たすことをいいます
[SRC[>>68]]。
[FIG(list)[
- [14] [[タスク]]が[[信頼済み]] [CODE(DOMe)@en[[[click]]]] [[イベント]]の[[活性化動作]]の処理中である
- [15] [[タスク]]が[[信頼済み]] [CODE(DOMe)@en[[[click]]]], [CODE(DOMe)@en[[[change]]]],
[CODE(DOMe)@en[contextmenu]],
[CODE(DOMe)@en[[[dblclick]]]], [CODE(DOMe)@en[[[mouseup]]]], [CODE(DOMe)@en[[[reset]]]],
[CODE(DOMe)@en[[[submit]]]],
[CODE(DOMe)@en[pointerup]],
[CODE(DOMe)@en[touchend]] [[イベント]]の[[イベントリスナー]]の処理中である
- [16] [[タスク]]が [[triggered by user activation]] な[[タスク]]から[[タスクキューに追加]]されたものである、
ただし最初の[[タスク]]から[[利用者エージェント]]定義の[[時間]]が経過していない
]FIG]
;; [17] 時間制限は、例えば[[クリック]]から数秒後ならともかく、数時間後は相応しくない
[SRC[>>68]] ことによります。
[EG[
[29] [CODE(HTMLe)@en[button]] の[[クリック]]時の[[ポップアップ]]は認められますが、
[CODE(HTMLe)@en[input]] の入力や [CODE(HTMLe)@en[select]] の変更では認められません。
]EG]
[31]
他に、[[閲覧文脈]]外部で[[利用者]]の明示的な指示があった場合も含めるべきと思われます。
[EG[
[32] 例えば[[利用者]]が[[ブックマーク]]から選択した[[ブックマークレット]]が
[CODE(JS)@en[window.open]] を実行した場合、[[ポップアップ窓]]が開かれるのが普通です。
]EG]
-*-*-
[64] [CODE(DOMi)@en[[[Location]]]] では、次のいずれかの条件を満たすと分岐します [SRC[>>65]]。 ([[タスク]]以外の判定条件もあります。 [CODE(DOMi)@en[[[Location]]]] 参照。)
[FIG(list)[
- [66] [[タスク]]が[[信頼済み]] [CODE(DOMe)@en[[[click]]]] [[イベント]]の[[活性化動作]]の処理中である
- [67] [[タスク]]が[[信頼済み]] [CODE(DOMe)@en[[[click]]]] [[イベント]]の[[イベントリスナー]]の処理中である
]FIG]
[18] [[タスク]]は、自身がこの条件を満たしているかどうかの情報を保持しておく必要があります。
また[[イベントオブジェクト]] (の持つ情報の一部または全部) も必要かもしれません。
例えば [CODE(JS)@en[[[window.open]]]] は、[[プラットフォームの慣習]]により、 [KBD[[[Ctrl]]]]
押下時に新しい[[閲覧文脈]]を常に開く、といったような動作にできます。
[25] 実際には [[triggered by user activation]] の実装 (またはその呼び出し元の実装)
は更に厳しく制限しているかもしれません。
[EG[
[27] 例えば同じ[[タスク]]内で多数の新しい[[最上位閲覧文脈]]を作成するのは[[ブラクラ]]であり、
拒否するべきと考えられます。
]EG]
[26] 更に、[[タスク]]を超えた制約もあるかもしれません。
[EG[
[28] 例えば [CODE(JS)@en[[[setTimeout]]]] を使って短時間に別の[[タスク]]で多くの新しい[[最上位閲覧文脈]]を作成するのは[[ブラクラ]]であり、
拒否するべきと考えられます。
]EG]
[19] [[triggered by user activation]] は、次の場面で使われます。
[FIG(list)[
- [[allowed to navigate]]
- [20] 新しい[[最上位閲覧文脈]]を開くかどうかの判断 ([[閲覧文脈名から閲覧文脈を選ぶ規則]]など)
- [21] [CODE(HTMLa)@en[[[download]]]] や [[navigate]] で[[ダウンロード]]するべきかの判断
- [24] [[navigate]] で[[ヘルパーアプリケーション]]を起動するべきかの判断
- [22] [CODE(DOMm)@en[[[requestAutocomplete]]]] 時
- [23] [CODE(HTML)@en[[[<input type=file>]]]] [[ダイアログ]]を開くかどうかの判断
- [[allowed to play]] の条件に使うことがあります。
]FIG]
[13] [[engagement gesture]] でも[[イベント]]のリストが参照されています。
* user orientation change
[10] [DFN[triggered by a user generated orientation change]] とは、
[[現在走っているタスク]]の [F[process user orientation change]] が[[真]]であることをいいます
[SRC[>>9]]。
* 全画面の要求
[5] [DFN[allowed to request fullscreen]] とは、
[FIG(list)[
- [6] [[triggered by user activation]]
- [7] [[triggered by a user generated orientation change]]
]FIG]
... の''いずれか''が[[真]]であることをいいます [SRC[>>4]]。
[8] これは、 [CODE(DOMm)@en[requestFullscreen]] で参照されます。
* 歴史
[1] [CITE@en[Editorial: "allowed to show a popup" → "triggered by user activation"]]
( ([[domenic]]著, [TIME[2016-06-01 17:23:12 +09:00]]))
<https://github.com/whatwg/html/commit/797f412eb78fd88bd5d0a1c098d17fbf1736c188>
[2] [CITE@en[Existing intervention: user gesture required for sensitive operations · Issue #12 · WICG/interventions]]
( ([TIME[2016-06-02 18:08:21 +09:00]]))
<https://github.com/WICG/interventions/issues/12>
[3] [CITE@en[Allow requestFullscreen() to be called from an orientation change event]]
([[mounirlamouri]]著, [TIME[2016-07-22 02:49:53 +09:00]])
<https://github.com/whatwg/fullscreen/commit/e5e96a9da944babf0e246980559cd80a46a300ca>
[11] [CITE@en[17041 – Setting location before the page is done loading shouldn't always be a replace load]]
( ([TIME[2016-08-26 14:04:08 +09:00]]))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=17041>
[12] [CITE@en[Consider pointerup and touchend for "triggered by user activation"]]
([[NavidZ]]著, [TIME[2016-10-13 05:29:42 +09:00]])
<https://github.com/whatwg/html/commit/adafe995c6d4f5f6df0497a534d31e51043b6750>
[30] [CITE@en[Add allow-top-navigation-by-user-activation sandbox token]]
([[domenic]]著, [TIME[2017-02-24 04:51:48 +09:00]])
<https://github.com/whatwg/html/commit/8abd73ec3a56541e3f6486d3a593a8bcfd67295d>
[33] [CITE@en[Require user gesture to request notification permissions · Issue #49 · WICG/interventions]]
([TIME[2017-07-16 00:39:12 +09:00]])
<https://github.com/WICG/interventions/issues/49>
[34] [CITE@en[Need concept of "consuming" user activation · Issue #3122 · whatwg/html]]
([TIME[2017-10-14 21:02:25 +09:00]])
<https://github.com/whatwg/html/issues/3122>
[35] [CITE@en[Treat trusted contextmenu events as user activation]]
([[mustaqahmed]]著, [TIME[2018-05-03 01:07:47 +09:00]])
<https://github.com/whatwg/html/commit/51bd770cf58cdd761674df0f47c9f9dfc58c5310>
[36] [CITE@en[Treat trusted `contextmenu` events as user activation. by mustaqahmed · Pull Request #3659 · whatwg/html]]
([TIME[2018-05-03 10:55:44 +09:00]])
<https://github.com/whatwg/html/pull/3659>