-
Notifications
You must be signed in to change notification settings - Fork 4
/
534.txt
278 lines (201 loc) · 12.6 KB
/
534.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
* 仕様書
[REFS[
- [6] [CITE@en-US[CSSOM View Module]]
( ([TIME[2010-08-31 18:26:26 +09:00]] 版))
<http://dev.w3.org/csswg/cssom-view/#dom-document-elementfrompoint>
- [51] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-01-30 08:05:01 +09:00]] 版) <https://html.spec.whatwg.org/#run-authentic-click-activation-steps>
]REFS]
* hit testing
[64] [[指示装置]]は、[[画面]]上の[[座標]] ([VAR[x]], [VAR[y]]) を[[プラットフォーム]]を通じて
[[Webブラウザー]]に通知します。 [[Webブラウザー]]は、その [[UI]]
と[[プラットフォームの慣習]]次第の[[Webブラウザー]]依存の方法で、
どの[[閲覧文脈]]にこれを通知するか (あるいはどれにも通知しないか) を決定します。
[52] 更には、[[閲覧文脈]]内の適当な[[要素]]を決定し、これを[[対象要素]]とします。
位置の決定は、 [[viewport]] を通じて[[画面]]に表示される[[画布]]内の[[要素]]の[[箱]]の位置と重なり具合によります。
[55] ただし、[[固定状態]]にあっては、無条件に[[対象][Pointer Lock対象]]を選択します
[SRC[[CITE[Pointer Lock]]]]。
[HISTORY[
[53] ただし、[[対象要素]]となるのが [CODE(HTMLe)@en[[[canvas]]]] [[要素]]なら、
[[画布[CODE(DOMi)@en[MouseEvent]]再経路付け手順]]によって[[対象要素]]を決定しなければ[['''なりません''']]
[SRC[>>51]]。
;; [[画布[CODE(DOMi)@en[MouseEvent]]再経路付け手順]]は[[イベントオブジェクト]]の
[CODE(DOMa)@en[[[region]]]] [[属性]]にも影響します。
]HISTORY]
[65] [[対象要素]]となるのが[[画像写像]]の場合には、
どの[[写像]]が選択されるかに[[座標]]が影響します。
[56] [[クリック]]は、その他の[[プラットフォームの慣習]]に基づく動作を発生させることがあります。
例えば、 [CODE(HTMLe)@en[[[input]]]] [[要素]]の値の変更 ([CODE(HTML)@en[[[<input type=range>]]]]
や[[日時]]系の[[制御子]])、 [CODE(HTMLe)@en[[[select]]]] [[要素]]の[[プルダウンメニュー]]の表示、
[[スクロールバー]]の操作などが実行されるかもしれません。
[66] [[座標]]は [CODE(DOMi)@en[MouseEvent]] [[インターフェイス]]を通じて[[イベントリスナー]]に通知されます。
@@
[FIG(list middle)[
- [11] [CODE(CSS)@en['[[pointer-events]]']] [[特性]]
- [CODE(CSS)@en[[[:visited]]]]
- [CODE(CSS)@en[[[transform]]]]
- [[アニメーション]]
- [CODE(CSS)@en[[[visibility]]]]
- [CODE(CSS)@en[[[opacity]]]], [[透過画像]], [[透過色]]
- [[グリフ]]
- [[画像写像]]
- [[背景画像]]
- [CODE(CSS)@en[[[:selection]]]]
- [[スクロールバー]]
- [[負]]の座標、[[viewport]] 外、[[根要素]]外
- [[SVG]]
- [[入れ子閲覧文脈]]
- [[プラグイン]]
- [[inert]]
- [[Shadow DOM]]
]FIG]
* [CODE(DOMi)@en[Document]] オブジェクト [CODE(DOMm)@en[elementFromPoint]] メソッド
[7] [CODE(DOMi)@en[[[Document]]]] [[オブジェクト]]の [DFN[[CODE(DOMm)@en[[[elementFromPoint]]]] [[メソッド]]]]は、
指定された[[座標]]に存在する[[要素]]を返します。
[14] 指定された[[座標]]で一番上に[[レンダリング]]されている[[要素]]が返されます。
[15] [[座標]]が [[viewport]] 外にあるときや[[根要素]]が存在しない時には [CODE@en[[[null]]]]
が返されます。
* 歴史
** [CODE(DOMm)@en[elementFromPoint]]
[50] 昔から実装されていました。
[8] 2007年6月に [[CSSOM]] ではじめて定義されました。
;;
[3] [CITE[csswg/cssom/Overview.src.html - diff - 1.42]]
( ([TIME[2010-12-30 21:31:38 +09:00]] 版))
<http://dev.w3.org/cvsweb/csswg/cssom/Overview.src.html.diff?r1=1.41&r2=1.42&f=h>
[9] 2007年12月に新設の [[CSSOM View]] 仕様書に移動しました。
;;
-[4] [CITE[csswg/cssom/Overview.src.html - diff - 1.60]]
( ([TIME[2010-12-30 21:33:14 +09:00]] 版))
<http://dev.w3.org/cvsweb/csswg/cssom/Overview.src.html.diff?r1=1.59&r2=1.60&f=h>
-[5] [CITE[csswg/cssom-view/Overview.src.html - view - 1.1]]
( ([TIME[2007-12-01 07:31:03 +09:00]] 版))
<http://dev.w3.org/cvsweb/csswg/cssom-view/Overview.src.html?rev=1.1&content-type=text/x-cvsweb-markup>
[12] [CITE@ja-jp[elementFromPoint]] ([TIME[2010-12-30 21:39:45 +09:00]] 版) <http://msdn.microsoft.com/ja-jp/library/cc428046.aspx>
[16] [[WinIE8]] は負の座標でも[[文書要素]]を返します。
[1] [[Opera]] は [CODE(DOMi)@en[[[Text]]]] を返すことがあります。
[10] [[Firefox]] は3以降で実装しています。
;; [2] [CITE@en-us[document.elementFromPoint - MDC Doc Center]]
( ([TIME[2010-12-30 21:29:40 +09:00]] 版))
<https://developer.mozilla.org/en/DOM/document.elementFromPoint>
** hit testing
[13] [CITE@en[W3C DOM Compatibility - CSS Object Model View]]
( ([TIME[2010-07-20 17:56:59 +09:00]] 版))
<http://www.quirksmode.org/dom/w3c_cssom.html#t20>
[17] [CITE@en[Advanced hit testing (Windows)]]
( ([TIME[2013-11-13 13:48:41 +09:00]] 版))
<http://msdn.microsoft.com/en-us/library/ie/hh673523(v=vs.85).aspx>
[27] [CITE@en[The 'pointer-events' property]] ([TIME[2009-02-08 19:53:14 +09:00]] 版) <http://webkit.org/specs/PointerEventsProperty.html>
[28] [CITE[Bug 11395 - allow the SVG pointer-events CSS property in HTML]] ([TIME[2009-02-08 19:53:39 +09:00]] 版) <https://bugs.webkit.org/show_bug.cgi?id=11395>
[29] [CITE[Bug 380573 – implement SVG 'pointer-events' property for all elements]] ([TIME[2009-02-08 19:54:05 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=380573>
[30] [CITE[Safari CSS Reference]]
([[Apple Inc.]] 著, [TIME[2009-09-05 22:49:33 +09:00]] 版)
<http://74.125.155.132/search?q=cache:GKZpflf2OcMJ:developer.apple.com/mac/library/documentation/AppleApplications/Reference/SafariCSSRef/SafariCSSRef.pdf#133>
[31] [CITE@en[Proposal for CSS 'pointer-events' property]]
([[Dean Jackson]] 著, [TIME[2008-07-19 05:17:22 +09:00]] 版)
<http://lists.w3.org/Archives/Public/www-style/2008Jul/0428.html>
[32] [CITE['''['''whatwg''']''' Non-blocking SVG Canvas?]]
([TIME[2010-08-06 08:19:04 +09:00]] 版)
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027669.html>
[33] [CITE[Bug 380573 – implement SVG 'pointer-events' property for all elements]]
([TIME[2010-08-06 08:18:25 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=380573>
[34] [CITE[Bug 11395 – allow the SVG pointer-events CSS property in HTML]]
([TIME[2010-08-06 08:19:44 +09:00]] 版)
<https://bugs.webkit.org/show_bug.cgi?id=11395>
[35] [CITE@en[The 'pointer-events' property]]
([TIME[2010-08-06 08:20:10 +09:00]] 版)
<http://webkit.org/specs/PointerEventsProperty.html>
[36] [CITE@en-US[pointer-events for HTML in Firefox 3.6 ✩ Mozilla Hacks – the Web developer blog]]
( ([TIME[2010-12-30 21:20:54 +09:00]] 版))
<http://hacks.mozilla.org/2009/12/pointer-events-for-html-in-firefox-3-6/>
[37] [CITE@en[Re: Proposal for CSS 'pointer-events' property]]
( ([[Ian Hickson]] 著, [TIME[2009-02-10 10:18:45 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2009Feb/0287.html>
[38] [CITE@en[Specifying hit testing in CSS]]
( ([[Leif Arne Storset]] 著, [TIME[2010-08-21 00:07:21 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2010Aug/0407.html>
[39] [CITE[IRC logs: freenode / #whatwg / 20110727]]
( ([TIME[2011-08-07 19:50:38 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110727#l-379>
[40] [CITE@en[CSS Basic User Interface Module Level 3 (CSS3 UI)]]
( ([[Tantek Çelik]] 著, [TIME[2011-09-29 17:32:08 +09:00]] 版))
<http://dev.w3.org/csswg/css3-ui/#pointer-events>
[41] [CITE@en[CSS Hit Testing Module]]
( ([TIME[2010-08-20 13:40:18 +09:00]] 版))
<http://people.opera.com/lstorset/TR/pointer-events/ED-pointer-events-20100820.html>
[42] [CITE@en[Re: Specifying hit testing in CSS]]
( ([[Leif Arne Storset]] 著, [TIME[2010-08-25 23:36:31 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2010Aug/0515.html>
[43] [CITE@en[Re: Proposal for CSS 'pointer-events' property]]
( ([[Ian Hickson]] 著, [TIME[2009-02-10 10:18:45 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2009Feb/0287.html>
[18] [CITE@en-US[csswg: changeset 4114:a1df2525134e]]
( ([TIME[2013-01-30 03:04:00 +09:00]] 版))
<https://dvcs.w3.org/hg/csswg/rev/a1df2525134e>
[19] [CITE[IRC logs: freenode / #whatwg / 20130412]]
( ([TIME[2013-04-17 20:42:27 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130412#l-386>
[20] [CITE@en[SVG:Language:Regrets - MozillaWiki]]
( ([TIME[2013-08-10 14:11:55 +09:00]] 版))
<https://wiki.mozilla.org/SVG:Language:Regrets#The_values_for_the_.27pointer-events.27_property>
[21] [CITE[IRC logs: freenode / #whatwg / 20120609]]
( ([TIME[2012-06-28 21:17:45 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120609>
[22] [CITE@en[Specifying hit testing in CSS]]
( ([[Leif Arne Storset]] 著, [TIME[2010-08-21 00:07:21 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2010Aug/0407.html>
[23] [CITE@en[Re: Proposal for CSS 'pointer-events' property]]
( ([[Ian Hickson]] 著, [TIME[2009-02-10 10:18:45 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2009Feb/0287.html>
[24] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-01-30 08:05:01 +09:00]] 版) <https://html.spec.whatwg.org/#image-map>
[25] [CITE[Introduction – SVG 1.1 (Second Edition)]]
( ([TIME[2011-08-10 12:35:27 +09:00]] 版))
<http://www.w3.org/TR/2011/REC-SVG11-20110816/intro.html#TermHitTesting>
[26] [CITE[IRC logs: freenode / #whatwg / 20141101]]
( ([TIME[2014-11-02 01:43:43 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20141101#l-62>
[44] [CITE@en[''''''['''''''''''']'''''' (0) Filling in the rendering section: remove hit testing (see www-… · whatwg/html@fceda3f]]
(10 Feb 2009)
<https://github.com/whatwg/html/commit/fceda3f08e335de7b9f9255a5e27a8cc7f160694>
[45] [CITE@en[If a user clicks on <button><i>hello</i></button>, does the event bubble to the document? · Issue #737 · whatwg/html]]
([TIME[2016-03-01 16:39:48 +09:00]] 版)
<https://github.com/whatwg/html/issues/737>
[46] [CITE@en[Difference between region behavior for MouseEvent and Touch · Issue #548 · whatwg/html]]
([TIME[2016-03-11 15:28:51 +09:00]] 版)
<https://github.com/whatwg/html/issues/548>
[47] [CITE@en[Re: Proposal for CSS 'pointer-events' property]]
([[Ian Hickson]] 著, [TIME[2009-02-10 10:18:45 +09:00]] 版)
<https://lists.w3.org/Archives/Public/www-style/2009Feb/0287.html>
[48] [CITE@en[Linking: borrow HTML attributes, explicitly allow nested links, cleanup]]
( ([[AmeliaBR]]著, [TIME[2016-06-22 21:54:34 +09:00]]))
<https://github.com/w3c/svgwg/commit/33f85d2bdd20e7d33eedff77b85b10c8451db397>
[49] [CITE@en[Specify the Event Loop integration for various non-deprecated events, incl. hit testing · Issue #23 · w3c/uievents]]
([TIME[2016-10-21 16:17:07 +09:00]])
<https://github.com/w3c/uievents/issues/23>
[54] [CITE@en[Remove canvas element's hit region feature (for now)]]
([[annevk]]著, [TIME[2016-10-21 18:01:07 +09:00]])
<https://github.com/whatwg/html/commit/9d493a37ed7e49c58522a3fed05d14bde1a8913c>
[57] [CITE@en[Clarify the hit test and capturing target for boundary events (#154)]]
([[NavidZ]]著, [TIME[2016-11-18 04:43:56 +09:00]])
<https://github.com/w3c/pointerevents/commit/91b660867545d87b5663170b2ad95aa7da69edab>
[58] [CITE@en[Mouse events & disabled form controls · Issue #2368 · whatwg/html]]
([TIME[2017-02-20 19:12:48 +09:00]])
<https://github.com/whatwg/html/issues/2368>
[59] [CITE@en[in view: test with pointer events enabled]]
([[andreastt]]著, [TIME[2017-04-18 03:17:44 +09:00]])
<https://github.com/w3c/webdriver/commit/ba6ee925b5bc85938d542d65ef5034a761fe73d7>
[60] [CITE@en[Align the title attribute with implementations by annevk · Pull Request #3435 · whatwg/html]]
([TIME[2018-02-01 19:57:26 +09:00]])
<https://github.com/whatwg/html/pull/3435>
[61] [CITE@en[Add note to mention UA might adjusting touch target (#95)]]
([[EiraGe]]著, [TIME[2018-04-27 10:58:29 +09:00]])
<https://github.com/w3c/touch-events/commit/279f64e255ac76fa47fc4510d2df9e68faf9590a>
[62] [CITE@en[Should spec mention “touch adjustment" behavior? · Issue #93 · w3c/touch-events]]
([TIME[2018-05-10 11:57:31 +09:00]])
<https://github.com/w3c/touch-events/issues/93>
[63] [CITE@en[Add note to mention UA might adjusting touch target by EiraGe · Pull Request #95 · w3c/touch-events]]
([TIME[2018-05-10 11:58:51 +09:00]])
<https://github.com/w3c/touch-events/pull/95>
[67] [CITE@en[Clarify hit testing behavior of <foreignObject> · Issue #427 · w3c/svgwg]]
([TIME[2018-05-18 15:31:49 +09:00]])
<https://github.com/w3c/svgwg/issues/427>