chore: use new school WebIDL (closes #13) (#14) · w3c/pointerlock@027f57a (original) (raw)

`@@ -177,7 +177,7 @@

Introduction

`

177

177

`

`

178

178

`

`

179

179

` This specification defines conformance criteria that apply to a single

`

180

``

`-

product: the user agent that implements

`

``

180

`+

product: the user agent that implements

`

181

181

` the interfaces that it contains.

`

182

182

`

`

183

183

``

`@@ -244,18 +244,21 @@

pointerlockchange and pointerlockerror Events

`

244

244

` assistive technologies like screen magnifiers.

`

245

245

`

`

246

246

``

247

``

`-

`

``

247

`+

`

248

248

`

Extensions to the Element Interface

`

249

249

`

`

250

250

` The Element interface is extended to provide the ability to

`

251

251

` request the the pointer be locked.

`

252

252

`

`

253

253

``

254

``

`-

`

255

``

`-

void requestPointerLock()

`

``

254

`+


`

``

`255`

`+

 partial interface Element {

`

``

`256`

`+

 void requestPointerLock();

`

``

`257`

`+

 };

`

``

`258`

`+

`

``

259

`+

`

``

260

`+

requestPointerLock

`

256

261

`

`

257

``

`-

`

258

``

-

259

262

`

Requests that the pointer be locked to a DOM element

`

260

263

`target. The user agent determines if pointer lock

`

261

264

` state will be entered and upon lock state change or error must send

`

`@@ -281,19 +284,19 @@

Extensions to the Element Interface

`

281

284

`browsing context

`

282

285

` need not be in focus.

`

283

286

``

284

``

`-

If a user has exited pointer lock via the default unlock user

`

``

287

`+

If a user has exited pointer lock via the default unlock

`

285

288

` gesture

, or pointer lock has not previously been entered for this

`

286

289

` document, an event generated as a result of an

`

287

290

`engagement gesture must be received by the document before

`

288

``

`-

requestPointerLock will succeed.

`

``

291

`+

requestPointerLock will succeed.

`

289

292

``

290

293

`

`

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.

`

295

298

``

296

``

`-

Conversely, if pointer lock is exited via exitPointerLock

`

``

299

`+

Conversely, if pointer lock is exited via exitPointerLock

`

297

300

` no engagement gesture 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 @@

Extensions to the Element Interface

`

335

338

`

`

336

339

`

`

337

340

``

338

``

`-

`

``

341

`+

`

339

342

`

Extensions to the Document Interface

`

340

343

``

341

``

`-

`

342

``

`-

attribute EventHandler onpointerlockchange

`

``

344

`+


`

``

`345`

`+

 partial interface Document {

`

``

`346`

`+

 attribute EventHandler onpointerlockchange;

`

``

`347`

`+

 attribute EventHandler onpointerlockerror;

`

``

`348`

`+

 void exitPointerLock();

`

``

`349`

`+

 };

`

``

`350`

`+

`

``

351

`+

`

``

352

`+

onpointerlockchange

`

343

353

`

`

344

``

`-

`

345

``

-

346

354

`

An event handler

`

347

355

` for pointerlockchange events.

`

348

356

`

`

349

357

``

350

``

`-

attribute EventHandler onpointerlockerror

`

``

358

`+

onpointerlockerror

`

351

359

`

`

352

``

`-

`

353

``

-

354

360

`

An event handler

`

355

361

` for pointerlockerror events.

`

356

362

`

`

357

363

``

358

``

`-

void exitPointerLock ()

`

``

364

`+

exitPointerLock

`

359

365

`

`

360

``

`-

`

361

``

-

362

366

`

Initiates an exit from pointer lock state if currently locked to a target whose

`

363

367

`shadow-including root

`

364

368

` is this document, and sends a pointerlockchange event when the lock state

`

`@@ -372,14 +376,17 @@

Extensions to the Document Interface

`

372

376

`

`

373

377

`

`

374

378

``

375

``

`-

`

``

379

`+

`

376

380

`

Extensions to the DocumentOrShadowRoot Mixin

`

377

381

``

378

``

`-

`

379

``

`-

readonly attribute Element? pointerLockElement

`

``

382

`+


`

``

`383`

`+

 partial interface DocumentOrShadowRoot {

`

``

`384`

`+

 readonly attribute Element ? pointerLockElement;

`

``

`385`

`+

 };

`

``

`386`

`+

`

``

387

`+

`

``

388

`+

pointerLockElement

`

380

389

`

`

381

``

`-

`

382

``

-

383

390

`

While the pointer is locked, returns the result of

`

384

391

`retargeting

`

385

392

` the element, which is the target for mouse events, against

`

`@@ -388,7 +395,7 @@

Extensions to the DocumentOrShadowRoot Mixin

`

388

395

`context object are in the

`

389

396

` same tree, otherwise returns null.

`

390

397

`

Returns null if lock is pending or if pointer is unlocked.

`

391

``

`-


`

``

`398`

`+


`

`392`

`399`

` <body>

`

`393`

`400`

` <div id="host1">

`

`394`

`401`

` <shadow-root id="root1">

`

`@@ -416,18 +423,22 @@ 

Extensions to the DocumentOrShadowRoot Mixin

` `416` `423` `
` `417` `424` `
` `418` `425` `` `419` `` `-
` `` `426` `+
` `420` `427` `

Extensions to the MouseEvent Interface

` `421` `428` `` `422` `429` `

User agents must extend the MouseEvent interface ` `423` `430` ` [[!UIEVENTS]] ` `424` `431` ` with two members:

` `425` `432` `` `426` `` `-
` `427` `` `-
readonly attribute long movementX
` `428` `` `-
` `429` `` `-
readonly attribute long movementY
` `430` `` `-
` `` `433` `+

`

``

`434`

`+

 partial interface MouseEvent {

`

``

`435`

`+

 readonly attribute long movementX;

`

``

`436`

`+

 readonly attribute long movementY;

`

``

`437`

`+

 };

`

``

`438`

`+

`

``

439

`+

`

``

440

`+

movementX

`

``

441

`+

movementY

`

431

442

`

`

432

443

``

433

444

`

The members movementX and movementY must

`

`@@ -483,19 +494,23 @@

Extensions to the MouseEvent Interface

`

483

494

` events when the cursor moves outside the window.

`

484

495

`

`

485

496

``

486

``

`-

`

``

497

`+

`

487

498

`

Extensions to the MouseEventInit Dictionary

`

488

499

``

489

500

`

User agents must extend the MouseEventInit dictionary

`

490

501

` [[!UIEVENTS]] with two members movementX and

`

491

502

`movementY used to initialize respective members

`

492

503

` of MouseEvent.

`

493

504

``

494

``

`-

`

495

``

`-

long movementX = 0

`

496

``

`-

`

497

``

`-

long movementY = 0

`

498

``

`-

`

``

505

`+


`

``

`506`

`+

 partial dictionary MouseEventInit {

`

``

`507`

`+

 long movementX = 0;

`

``

`508`

`+

 long movementY = 0;

`

``

`509`

`+

 };

`

``

`510`

`+

`

``

511

`+

`

``

512

`+

movementX

`

``

513

`+

movementY

`

499

514

`

`

500

515

`

`

501

516

``

`@@ -592,7 +607,7 @@

Synthetic cursor interaction with HTML DOM UI

`

592

607

` following code should permit a custom cursor to send click events while

`

593

608

` the pointer is locked:

`

594

609

``

595

``

`-


`

``

`610`

`+


`

`596`

`611`

` document.addEventListener("click", function (e) {

`

`597`

`612`

` if (e._isSynthetic)

`

`598`

`613`

` return;

`