@@ -177,7 +177,7 @@ <h2>Introduction</h2>
177
177
< section id ='conformance '>
178
178
< p >
179
179
This specification defines conformance criteria that apply to a single
180
- product: the < dfn id =" dfn-user-agent " > user agent</ dfn > that implements
180
+ product: the < dfn > user agent</ dfn > that implements
181
181
the interfaces that it contains.
182
182
</ p >
183
183
@@ -244,18 +244,21 @@ <h2><code>pointerlockchange</code> and <code>pointerlockerror</code> Events</h2>
244
244
assistive technologies like screen magnifiers.</ p >
245
245
</ section >
246
246
247
- < section >
247
+ < section data-dfn-for =" Element " >
248
248
< h2 > Extensions to the < a > Element</ a > Interface</ h2 >
249
249
< p >
250
250
The < a > Element</ a > interface is extended to provide the ability to
251
251
request the the pointer be locked.
252
252
</ p >
253
253
254
- < dl title ='partial interface Element ' class ='idl '>
255
- < dt > void requestPointerLock()</ dt >
254
+ < pre class ="idl ">
255
+ partial interface Element {
256
+ void requestPointerLock();
257
+ };
258
+ </ pre >
259
+ < dl >
260
+ < dt > < dfn > requestPointerLock</ dfn > </ dt >
256
261
< dd >
257
- < dfn title ="requestPointerLock "> </ dfn >
258
-
259
262
< p > Requests that the pointer be locked to a DOM element
260
263
< dfn > target</ dfn > . The < a > user agent</ a > determines if pointer lock
261
264
state will be entered and upon lock state change or error must send
@@ -281,19 +284,19 @@ <h2>Extensions to the <a>Element</a> Interface</h2>
281
284
< a href ="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context "> browsing context</ a >
282
285
need not be in focus.</ p >
283
286
284
- < p > If a user has exited pointer lock via the < a > default unlock user
287
+ < p > If a user has exited pointer lock via the < a > default unlock
285
288
gesture</ a > , or pointer lock has not previously been entered for this
286
289
document, an event generated as a result of an
287
290
< a > engagement gesture</ a > must be received by the document before
288
- < a > requestPointerLock</ a > will succeed.</ p >
291
+ < a data-lt =" Element.requestpointerlock " > requestPointerLock</ a > will succeed.</ p >
289
292
290
293
< p class ="note ">
291
294
This ensures a user can leave a
292
295
document that constantly attempts to lock the pointer. The document
293
296
will be blocked from locking upon initial navigation or re-acquiring
294
297
lock unless the user re-engages directly with the document.< br > < br >
295
298
296
- Conversely, if pointer lock is exited via < a > exitPointerLock</ a >
299
+ Conversely, if pointer lock is exited via < a data-lt =" Document.exitpointerlock " > exitPointerLock</ a >
297
300
no < a > engagement gesture</ a > is required to reenter pointer lock. This enables
298
301
applications that frequently move between interaction modes, and
299
302
ones that may do so based on a timer or remote network activity.
@@ -335,30 +338,31 @@ <h2>Extensions to the <a>Element</a> Interface</h2>
335
338
</ dl >
336
339
</ section >
337
340
338
- < section >
341
+ < section data-dfn-for =" Document " >
339
342
< h2 > Extensions to the < a > Document</ a > Interface</ h2 >
340
343
341
- < dl title ='partial interface Document ' class ='idl '>
342
- < dt > attribute EventHandler onpointerlockchange</ dt >
344
+ < pre class ="idl ">
345
+ partial interface Document {
346
+ attribute EventHandler onpointerlockchange;
347
+ attribute EventHandler onpointerlockerror;
348
+ void exitPointerLock();
349
+ };
350
+ </ pre >
351
+ < dl >
352
+ < dt > < dfn > onpointerlockchange</ dfn > </ dt >
343
353
< dd >
344
- < dfn title ="onpointerlockchange "> </ dfn >
345
-
346
354
< p > An < a href ="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers "> event handler</ a >
347
355
for < a > pointerlockchange</ a > events.</ p >
348
356
</ dd >
349
357
350
- < dt > attribute EventHandler onpointerlockerror</ dt >
358
+ < dt > < dfn > onpointerlockerror</ dfn > </ dt >
351
359
< dd >
352
- < dfn title ="onpointerlockerror "> </ dfn >
353
-
354
360
< p > An < a href ="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers "> event handler</ a >
355
361
for < a > pointerlockerror</ a > events.</ p >
356
362
</ dd >
357
363
358
- < dt > void exitPointerLock () </ dt >
364
+ < dt > < dfn > exitPointerLock</ dfn > </ dt >
359
365
< dd >
360
- < dfn title ="exitPointerLock "> </ dfn >
361
-
362
366
< p > Initiates an exit from pointer lock state if currently locked to a target whose
363
367
< a href ="https://dom.spec.whatwg.org/#concept-shadow-including-root "> shadow-including root</ a >
364
368
is this document, and sends a < a > pointerlockchange</ a > event when the lock state
@@ -372,14 +376,17 @@ <h2>Extensions to the <a>Document</a> Interface</h2>
372
376
</ dl >
373
377
</ section >
374
378
375
- < section >
379
+ < section data-dfn-for =" DocumentOrShadowRoot " >
376
380
< h2 > Extensions to the < a > DocumentOrShadowRoot</ a > Mixin</ h2 >
377
381
378
- < dl title ='partial interface DocumentOrShadowRoot ' class ='idl '>
379
- < dt > readonly attribute Element? pointerLockElement</ dt >
382
+ < pre class ="idl ">
383
+ partial interface DocumentOrShadowRoot {
384
+ readonly attribute Element ? pointerLockElement;
385
+ };
386
+ </ pre >
387
+ < dl >
388
+ < dt > < dfn > pointerLockElement</ dfn > </ dt >
380
389
< dd >
381
- < dfn title ="pointerLockElement "> </ dfn >
382
-
383
390
< p > While the pointer is locked, returns the result of
384
391
< a href ="https://dom.spec.whatwg.org/#retarget "> retargeting</ a >
385
392
the element, which is the target for mouse events, against
@@ -388,7 +395,7 @@ <h2>Extensions to the <a>DocumentOrShadowRoot</a> Mixin</h2>
388
395
< a href ="https://dom.spec.whatwg.org/#context-object "> context object</ a > are in the
389
396
same tree, otherwise returns null.</ p >
390
397
< p > Returns null if lock is pending or if pointer is unlocked.</ p >
391
- < pre class ='example highlight ' id ="example-retarget-pointerlock ">
398
+ < pre class ='example ' id ="example-retarget-pointerlock ">
392
399
<body>
393
400
<div id="host1">
394
401
<shadow-root id="root1">
@@ -416,18 +423,22 @@ <h2>Extensions to the <a>DocumentOrShadowRoot</a> Mixin</h2>
416
423
</ dl >
417
424
</ section >
418
425
419
- < section >
426
+ < section data-dfn-for =" MouseEvent " >
420
427
< h2 > Extensions to the < a > MouseEvent</ a > Interface</ h2 >
421
428
422
429
< p > < a > User agent</ a > s must extend the MouseEvent interface
423
430
[[!UIEVENTS]]
424
431
with two members:</ p >
425
432
426
- < dl title ='partial interface MouseEvent ' class ='idl '>
427
- < dt > readonly attribute long movementX</ dt >
428
- < dd > < dfn title ="movementX "> </ dfn > </ dd >
429
- < dt > readonly attribute long movementY</ dt >
430
- < dd > < dfn title ="movementY "> </ dfn > </ dd >
433
+ < pre class ="idl ">
434
+ partial interface MouseEvent {
435
+ readonly attribute long movementX;
436
+ readonly attribute long movementY;
437
+ };
438
+ </ pre >
439
+ < dl >
440
+ < dt > < dfn > movementX</ dfn > </ dt >
441
+ < dt > < dfn > movementY</ dfn > </ dt >
431
442
</ dl >
432
443
433
444
< p > The members < code > movementX</ code > and < code > movementY</ code > must
@@ -483,19 +494,23 @@ <h2>Extensions to the <a>MouseEvent</a> Interface</h2>
483
494
events when the cursor moves outside the window.</ p >
484
495
</ section >
485
496
486
- < section >
497
+ < section data-dfn-for =" MouseEventInit " >
487
498
< h2 > Extensions to the < a > MouseEventInit</ a > Dictionary</ h2 >
488
499
489
500
< p > < a > User agent</ a > s must extend the MouseEventInit dictionary
490
501
[[!UIEVENTS]] with two members < code > movementX</ code > and
491
502
< code > movementY</ code > used to initialize respective members
492
503
of < code > MouseEvent</ code > .</ p >
493
504
494
- < dl title ='partial dictionary MouseEventInit ' class ='idl '>
495
- < dt > long movementX = 0</ dt >
496
- < dd > </ dd >
497
- < dt > long movementY = 0</ dt >
498
- < dd > </ dd >
505
+ < pre class ="idl ">
506
+ partial dictionary MouseEventInit {
507
+ long movementX = 0;
508
+ long movementY = 0;
509
+ };
510
+ </ pre >
511
+ < dl >
512
+ < dt > < dfn > movementX</ dfn > </ dt >
513
+ < dt > < dfn > movementY</ dfn > </ dt >
499
514
</ dl >
500
515
</ section >
501
516
@@ -592,7 +607,7 @@ <h2>Synthetic cursor interaction with HTML DOM UI</h2>
592
607
following code should permit a custom cursor to send click events while
593
608
the pointer is locked:</ p >
594
609
595
- < pre class ='example highlight ' id ="example-synthetic-cursor ">
610
+ < pre class ='example ' id ="example-synthetic-cursor ">
596
611
document.addEventListener("click", function (e) {
597
612
if (e._isSynthetic)
598
613
return;
0 commit comments