/
314.txt
384 lines (288 loc) · 17.4 KB
/
314.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
[11] [[HTML]] の[[フォーム制御子]]の
[DFN[[CODE(HTMLa)@en[autocomplete]] [[属性]]]]は、
[[自動補完]]を有効とするべきかどうかを指定します。
[13]
:状態:[[WHATWG]] [[勧告案]] ([[WD]]~[[LC]])
:[[要素]]:[CODE(HTMLe)@en[[[form]]]]、[CODE(HTMLe)@en[[[input]]]]
:[CODE(HTMLa)@en[[[type]]]]:[CODE(HTML)@en[[[text]]]],
[CODE(HTML)@en[[[password]]]],
[CODE(HTML)@en[[[date]]]], [CODE(HTML)@en[[[datetime]]]],
[CODE(HTML)@en[[[datetime-local]]]], [CODE(HTML)@en[[[month]]]],
[CODE(HTML)@en[[[week]]]], [CODE(HTML)@en[[[time]]]],
[CODE(HTML)@en[[[email]]]], [CODE(HTML)@en[[[url]]]],
[CODE(HTML)@en[[[number]]]], [CODE(HTML)@en[[[range]]]],
[CODE(HTMLe)@en[[[search]]]],
[CODE(HTMLe)@en[[[color]]]],
[CODE(HTMLe)@en[[[tel]]]]
:[[属性名]]:[CODE(HTMLa)@en[[[autocomplete]]]]
([Q@en[[[auto complete]]]] ([Q[[[]自動補完]]]) より)
:[[属性値]]:[[列挙型]] (>>14)
:[[既定値]]:[CODE(HTML)@en[[[on]]]] (>>15)
* 仕様書
-[54] [CITE@en-US-x-hixie[HTML 5]]
-- [CODE(HTMLe)@en[[[form]]]] <http://www.whatwg.org/specs/web-apps/current-work/#attr-form-autocomplete>
-- [CODE(HTMLe)@en[[[input]]]] <http://www.whatwg.org/specs/web-apps/current-work/#attr-input-autocomplete>
* 属性値
[14]
指定可能な[[属性値]]:
- [15] [CODE(HTML)@en[[[on]]]] ([[既定値]]):
[[フォーム制御子]]の入力データは特に注意を要するほどではなく、
以前入力した値を[[利用者エージェント]]が覚えていてくれることを[[利用者]]が期待してもよい性質のものであることを示します。
[SRC@en[WF2 2.9]]
- [16] [CODE(HTML)@en[[[off]]]]
[[フォーム制御子]]の入力データが特に注意を要するものである
(例: [[核兵器]]の[[合言葉]]。) か、
決して再利用されることのないものである
(例: [[銀行口座]]の[[一時合言葉]]。) ことから、
[[利用者エージェント]]が候補値を提示できるようにせずに、
[[利用者]]が毎回入力するべきであることを示します。
[SRC@en[WF2 2.9]]
[17]
[CODE(HTMLa)@en[[[autocomplete]]]] [[属性値]]が
[CODE(HTML)@en[[[off]]]] の場合、
[[利用者エージェント]]は、
その[[欄]]の[[値]]を記憶[['''するべきではありません''']]。
[SRC@en[WF2 2.9]]
[18]
>>17 以外の場合、[[利用者エージェント]]は、
[[利用者]]がその[[欄]]に入力した[[値]]を記憶し、
以後[[利用者]]がその[[頁]]に戻った時に[[利用者エージェント]]が[[フォーム]]を予め埋めてられるように[['''して構いません''']]。
[SRC@en[WF2 2.9]]
[3] [[WinIE 6]] で試してみましたが、
[[値]]の[[大文字]]・[[小文字]]は区別しませんでした。
[27]
[[WinIE 6]] では、
[CODE(HTML)[form/@autocomplete='off']] のときは、
[CODE(HTML)[input/@autocomplete]] の指定は無視されます。
そうでないときは無視されません。
** レンダリング
[19]
[[Web Forms 2.0]] は、[[自動補完]]の機構を具体的には定義していません。
[[利用者エージェント]]は、仕様書に違反しない範囲内で、
[[安全性]]や[[個人情報保護]]を考慮した上で自由に[[自動補完]]機構を実装[['''して構いません''']]。
[SRC@en[WF2 2.9]]
[21]
[[利用者エージェント]]は、
[[利用者]]がこの[[属性]]への対応を無効化できるように[['''して構いません''']]。
この[[属性]]への対応は既定状態で有効に[['''するべきです''']]。
無効化すると[[安全性]]の問題が生じる虞があるので、
[[利用者]]が簡単に無効化できるように[['''するべきではありません''']]。
[SRC@en[WF2 2.9]]
[8] [[Mozilla]] では [CODE(HTMLa)@en[[[autocomplete]]]]
[[属性]]つきの [CODE(HTMLe)@en[[[input]]]]
[[要素]]は赤枠で表示されます。
** 安全性
[9] [[自動補完]]のための記録を取っておくと、
その記録の保管場所や保管方法 [WEAK[([[ファイル]]の[[アクセス権]]など)]]
によっては第3者に見られてしまうことがあります。また、
実際の[[フォーム]]入力時に候補を[[画面]]の後ろから覗き込まれたり、
他人に使わせた時に見られてしまったりすることもあります。
[[会員番号]]や[[クレジット・カード]]の番号などが漏れてしまうと危険ですし、
そうでなくても本人の知られたくない個人的な情報を知られてしまう危険性があります。
[[利用者エージェント]]は:
- 完全に[[自動補完]]を無効にできるべきです。
- [[自動補完]]が有効かどうか簡単に確認できるべきです。
- 記録の保管方法について、その環境に合わせた安全な方法を採用するべきです。
- 記録の一部又は全部を手動で消去できるべきです。
- [[窓]]を閉じた時や他の[[サイト]]に移動した時など、
適当な時期に自動的に記録を消去する機能があると便利です。
- [[サイト]] ([[ドメイン]]や [CODE(ABNF)@en[[[path]]]])
によって記録するかしないか選択できる機能があると便利です。
- 共用の[[計算機]]での利用を想定するなら、
[[自動補完]]を使用するかの設定 [WEAK[(を含む各種の設定)]]
に[[管理者]]権限を要求
[WEAK[(例えば[[合言葉]]を要求)]] できるようにするべきです。
- 個々の[[フォーム]]や入力欄ごとに記録を消去する機能があると便利です。
[[管理者]]は:
- 共用の[[計算機]]では[[自動補完]]を無効にしておくべきです。
- 共用の[[計算機]]では[[自動補完]]を使用するかの設定
[WEAK[(を含む各種の設定)]] を一般の[[利用者]]が行えなくするべきです。
[[利用者]]は:
- [[自動補完]]が有効かどうかに注意するべきです。
- 共用の[[計算機]]で[[自動補完]]が有効になっていた場合、
使用後に必ず記録を消去するべきです。
* 歴史
** 誕生
@@ ・・・
** Web Forms 2.0 による標準化
-[12] [[Web Forms 2.0]]
-- [CSECTION@en[2.9. The [CODE(HTMLa)@en[[[autocomplete]]]] attribute]]
<IW:WF2:"#the-autocomplete">
[23]
[[銀行]]業界では、 [[Webサイト]]の入力欄で[[自動補完]]を無効化できることを非常に強く望んでおり、
それを受けて多くの[[利用者エージェント]]が
[CODE(HTMLa)@en[[[autocomplete]]]]
[[属性]]を[[実装]]していました。
[SRC@en[WF2 2.9]]
[22]
[[W3C]] はこの状況を無視してきましたが、
[[Web Forms 2.0]] は当初から
[CODE(HTMLa)@en[[[autocomplete]]]]
[[属性]]を提案の中に含めていました。
** [CODE(HTMLe)@en[form]] [CODE(HTMLa)@en[autocomplete]]
[53] 元々 [[HTML5]] への [[WF2]] の併合後、[[IE]] は [CODE(HTMLe)@en[[[form]]]] [[要素]]にも [CODE(HTMLa)@en[[[autocomplete]]]] [[属性]]を持っており、
それへの対応が必要であろうと仕様書の[[注釈]]に記されていました。
[51] ですが、実際利用率は高くなく、一旦は不必要と判断されました。
;; [CITE@en[(X)HTML5 Tracking]] ([TIME[2008-12-24 22:46:29 +09:00]] 版) <http://html5.org/tools/web-apps-tracker?from=2564&to=2565>
>give up on <form autocomplete>.
>IE also applies it to <form> elements, but only 0.09% of pages
use it there, so we don't support that. (It doesn't apply it to
<textarea>, so we don't support it there either.)
[52]
2009年になって再考されて仕様に追加されました。
;; [CITE@en[(X)HTML5 Tracking]] ([TIME[2009-07-26 18:34:56 +09:00]] 版) <http://html5.org/tools/web-apps-tracker?from=2797&to=2798>
* 実装
[1] [CODE(HTMLe)[[[form]]]] 要素及び
[CODE(HTMLe)[[[input]]]] 要素の
[CODE(HTMLa)[autocomplete]] 属性は、 [[WinIE]] 5+
で[[実装]]されています。
[24]
[[WinIE 6]] では、
設定で自動補完しないことになっている場合には、
この属性の値が上書きすることはありません。
[7] >>6 によると、 [[Netscape]] 6.2 / [[Mozilla]] 0.9.4 以降では
[CODE(HTMLe)@en[[[form]]]] [[要素]]の
[CODE(HTMLa)@en[[[autocomplete]]]] [[属性]]に対応しています。
[[#comment]]
** 例
[20]
[PRE(HTML example code)[
<p>Account: <input type="text" name="ac" autocomplete="off" /></p>
<p>PIN: <input type="text" name="pin" autocomplete="off" /></p>
]PRE]
[[銀行]]の [[Webサイト]]では、この例のように、
[[自動補完]]を無効化させたいことがよくあります。
[SRC@en[WF2 2.9]]
[49]
[CITE[ログイン(SSLモード) - Yahoo! JAPAN]] ([CODE[2007-07-03 23:33:48 +09:00]] 版) <https://login.yahoo.co.jp/config/login>
[CODE(HTML)@en[autocomplete="off"]]
が [CODE(HTMLe)@en[[[form]]]] に''だけ''指定されています。
([[名無しさん]])
[50]
[CITE[キーワード ブログ検索 :: 最新ブログ記事のトレンドがわかる ::]] ([TIME[2007-08-02 22:07:04 +09:00]] 版) <http://tag.kutsulog.net/tags/category>
>
[PRE(HTML bad example code)[
<input name="data[Tag][text]" autocomplete="off" size="10" style="width:200px;" value="" type="text" id="TagText" />
]PRE]
なんで off にしてるのだろう?
([[名無しさん]])
[[#comment]]
** 関連
[4] 関連する機能として、 [CODE(HTMLe)@en[[[input]]]] [[要素]]の [CODE(HTMLa)@en[[[vcard_name]]]] [[属性]]というのもあります。
[[#comment]]
** メモ
- [2] ''HTML AUTOCOMPLETE - HTML Code Tutorial'' <http://www.htmlcodetutorial.com/forms/_INPUT_AUTOCOMPLETE.html>
- [3] ''Autocomplete feature of Internet Explorer'' <http://www.geocities.com/technofundo/tech/web/ie_autocomplete.html>
- [5] <IW:WWWTest:"html/form/winie">
- [6] ''How to Turn Off Form Autocompletion'' <http://devedge.netscape.com/viewsource/2003/form-autocompletion/>
[55] [CITE@@en[Web Applications 1.0 r5332 Change how .autocomplete is reflected.Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=9636]]
( ([TIME[2010-08-25 04:40:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5331&to=5332>
[56] [[Android]] の[[Webブラウザー]]は [CODE(HTML)@en[[[<input type=email>]]]]
があると [CODE(HTML)@en[[[<input type=password>]]]] の[[自動補完]]がきかなくなるらしいです。
[TIME[2011-01-09T06:00:19.300Z]]
[57] [CITE[''''''[''''''whatwg'''''']'''''' Search-suggestions without scripting]]
( ([TIME[2012-05-05 09:41:41 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035681.html>
[58] [CITE@en[''''''[''''''chrome'''''']'''''' Index of /trunk/src/chrome/test/data/autofill/heuristics/input]]
( ([TIME[2012-07-24 01:11:55 +09:00]] 版))
<https://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/autofill/heuristics/input/>
[59] [CITE@en[Web Applications 1.0 r7208 Rearrange how 'autocomplete' is defined to make it possible to apply it to other controls]]
( ([TIME[2012-07-27 04:10:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7207&to=7208>
[60] [CITE@en[Web Applications 1.0 r7222 The second coming of autocomplete: now with lots more granularity.]]
( ([TIME[2012-08-02 08:38:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7221&to=7222>
[61] [CITE[''''''[''''''whatwg'''''']'''''' A mechanism to improve form autofill]]
( ([TIME[2012-08-03 04:40:21 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-August/036791.html>
[62] [CITE@en[Autofill forms - Google Chrome Help]]
( ([TIME[2012-08-04 00:12:30 +09:00]] 版))
<https://support.google.com/chrome/bin/answer.py?hl=en&answer=142893&p=settings_autofill>
[63] [CITE@en[Web Applications 1.0 r7242 Typo in field name for autocomplete]]
( ([TIME[2012-08-10 12:10:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7241&to=7242>
[64] [CITE[IRC logs: freenode / #whatwg / 20120802]]
( ([TIME[2012-08-17 23:51:17 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120802>
[65] [CITE[''''''[''''''whatwg'''''']'''''' Autocomplete and autofill features and feedback thereon]]
( ([TIME[2012-11-21 01:51:30 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/038039.html>
[66] [CITE[''''''[''''''whatwg'''''']'''''' Autocomplete and autofill features and feedback thereon]]
( ([TIME[2012-11-21 01:51:30 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/038039.html>
[67] [CITE@en[Web Applications 1.0 r7520 Fix autocomplete features based on recent feedback.]]
( ([TIME[2012-11-21 10:19:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7519&to=7520>
[68] [CITE[''''''[''''''whatwg'''''']'''''' Autocomplete and autofill features and feedback thereon]]
( ([TIME[2012-12-11 03:49:12 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038302.html>
[69] [CITE[IRC logs: freenode / #whatwg / 20121211]]
( ([TIME[2012-12-16 20:51:32 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20121211>
[70] [CITE@en[Web Applications 1.0 r7983 Clarify formats for autofill fields]]
( ([TIME[2013-06-18 08:27:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7982&to=7983>
[71] [CITE[''''''[''''''whatwg'''''']'''''' Proposal:Improve internationalization in the autocomplete attribute]]
( ([TIME[2013-06-18 08:27:19 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-June/039761.html>
[72] [CITE@en[Web Applications 1.0 r8100 Add 'country-name' field to autofill section, and some editorial polish around there.]]
( ([TIME[2013-07-30 05:47:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8099&to=8100>
[73] [CITE@en[Web Applications 1.0 r8384 Define some authoring conformance criteria that e.g. prevent autocomplete='shipping tel' being set on an <input type=date>]]
( ([TIME[2014-01-08 09:24:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8383&to=8384>
[74] [CITE@en[Web Applications 1.0 r8383 Make the spec consistent on whether <select> takes autocomplete='' (it now unambiguously does; this is, I believe, a new feature that browsers don't yet support).]]
( ([TIME[2014-01-08 08:36:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8382&to=8383>
[75] [CITE@en[Passsword managers and autocomplete='off']]
( ([[Joel Weinberger]] 著, [TIME[2013-12-13 04:20:52 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webapps/2013OctDec/1002.html>
[76] [CITE[''''''[''''''whatwg'''''']'''''' Various autocomplete="" topics]]
( ([TIME[2014-04-03 09:49:45 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-April/126960.html>
[77] [CITE@en[Web Applications 1.0 r8569 Make 'autocomplete' and 'autocompleteerror' bubble, like 'submit'.]]
( ([TIME[2014-04-10 07:22:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8568&to=8569>
[78] [CITE@en[Web Applications 1.0 r8569 Make 'autocomplete' and 'autocompleteerror' bubble, like 'submit'.]]
( ([TIME[2014-04-10 07:22:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8568&to=8569>
[79] [CITE@en[Web Applications 1.0 r8573 Add some autofill keywords for usernames and passwords.]]
( ([TIME[2014-04-15 03:03:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8572&to=8573>
[80] [CITE[''''''[''''''whatwg'''''']'''''' Various autocomplete="" topics]]
( ([TIME[2014-04-11 23:48:24 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-April/254094.html>
[81] [CITE[''''''[''''''whatwg'''''']'''''' Various autocomplete="" topics]]
( ([TIME[2014-04-25 23:55:06 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-April/254174.html>
[82] [CITE@en[Web Applications 1.0 r8648 autofill: requestAutocomplete() should not need the form in a Document; section-* should be opaque.]]
( ([TIME[2014-05-23 03:52:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8647&to=8648>
[83] [CITE@en[Web Applications 1.0 r8654 Change how addresses are marked up for autofill, since some locales don't fit the region/locality split]]
( ([TIME[2014-06-05 08:26:00 +09:00]] 版))
<http://html5.org/r/8654>
[84] [CITE@en[Web Applications 1.0 r8656 Add 'autocomplete' IDL attribute to HTMLSelectElement for consistency.]]
( ([TIME[2014-06-05 11:18:00 +09:00]] 版))
<http://html5.org/r/8656>
[85] [CITE@en[Web Applications 1.0 r8735 Add transaction-currency and transaction-amount fields for autofill.]]
( ([TIME[2014-08-30 07:57:00 +09:00]] 版))
<http://html5.org/r/8735>
[86] [CITE@en[Web Applications 1.0 r8736 allow autocomplete to be specified on type=hidden]]
( ([TIME[2014-09-03 06:29:00 +09:00]] 版))
<http://html5.org/r/8736>
[87] [CITE@en[Web Applications 1.0 r8794 autofill: Encourage password saving.]]
( ([TIME[2014-09-20 06:16:00 +09:00]] 版))
<https://html5.org/r/8794>
[88] [CITE@en[Bug 25238 – autocomplete fields: API to trigger saving even when form is not submitted]]
( ([TIME[2014-10-02 12:51:33 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=25238>
[89] [CITE@en[Credential Management]]
( ([TIME[2014-09-06 15:49:34 +09:00]] 版))
<https://mikewest.github.io/credentialmanagement/spec/>
[90] [CITE[Proposals for Gathering Consumer Demographics]]
( ([TIME[1998-10-23 05:05:00 +09:00]] 版))
<http://www.w3.org/Privacy/Proposals.html>
[91] [CITE[jQuery - autocomplete で入力中に候補を選択した場合、フォームにセットされない - Qiita]]
( ([TIME[2014-11-13 06:40:57 +09:00]] 版))
<http://qiita.com/syetuya/items/229e8adb75e24e031bcd>