Skip to content

Commit 027f57a

Browse files
Marcos Cáceresscheib
Marcos Cáceres
authored andcommitted
chore: use new school WebIDL (closes #13) (#14)
1 parent 01fefaa commit 027f57a

File tree

1 file changed

+54
-39
lines changed

1 file changed

+54
-39
lines changed

index.html

+54-39
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h2>Introduction</h2>
177177
<section id='conformance'>
178178
<p>
179179
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
181181
the interfaces that it contains.
182182
</p>
183183

@@ -244,18 +244,21 @@ <h2><code>pointerlockchange</code> and <code>pointerlockerror</code> Events</h2>
244244
assistive technologies like screen magnifiers.</p>
245245
</section>
246246

247-
<section>
247+
<section data-dfn-for="Element">
248248
<h2>Extensions to the <a>Element</a> Interface</h2>
249249
<p>
250250
The <a>Element</a> interface is extended to provide the ability to
251251
request the the pointer be locked.
252252
</p>
253253

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>
256261
<dd>
257-
<dfn title="requestPointerLock"></dfn>
258-
259262
<p>Requests that the pointer be locked to a DOM element
260263
<dfn>target</dfn>. The <a>user agent</a> determines if pointer lock
261264
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>
281284
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a>
282285
need not be in focus.</p>
283286

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
285288
gesture</a>, or pointer lock has not previously been entered for this
286289
document, an event generated as a result of an
287290
<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>
289292

290293
<p class="note">
291294
This ensures a user can leave a
292295
document that constantly attempts to lock the pointer. The document
293296
will be blocked from locking upon initial navigation or re-acquiring
294297
lock unless the user re-engages directly with the document.<br><br>
295298

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>
297300
no <a>engagement gesture</a> is required to reenter pointer lock. This enables
298301
applications that frequently move between interaction modes, and
299302
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>
335338
</dl>
336339
</section>
337340

338-
<section>
341+
<section data-dfn-for="Document">
339342
<h2>Extensions to the <a>Document</a> Interface</h2>
340343

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>
343353
<dd>
344-
<dfn title="onpointerlockchange"></dfn>
345-
346354
<p>An <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers">event handler</a>
347355
for <a>pointerlockchange</a> events.</p>
348356
</dd>
349357

350-
<dt>attribute EventHandler onpointerlockerror</dt>
358+
<dt><dfn>onpointerlockerror</dfn></dt>
351359
<dd>
352-
<dfn title="onpointerlockerror"></dfn>
353-
354360
<p>An <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers">event handler</a>
355361
for <a>pointerlockerror</a> events.</p>
356362
</dd>
357363

358-
<dt>void exitPointerLock ()</dt>
364+
<dt><dfn>exitPointerLock</dfn></dt>
359365
<dd>
360-
<dfn title="exitPointerLock"></dfn>
361-
362366
<p>Initiates an exit from pointer lock state if currently locked to a target whose
363367
<a href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</a>
364368
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>
372376
</dl>
373377
</section>
374378

375-
<section>
379+
<section data-dfn-for="DocumentOrShadowRoot">
376380
<h2>Extensions to the <a>DocumentOrShadowRoot</a> Mixin</h2>
377381

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>
380389
<dd>
381-
<dfn title="pointerLockElement"></dfn>
382-
383390
<p>While the pointer is locked, returns the result of
384391
<a href="https://dom.spec.whatwg.org/#retarget">retargeting</a>
385392
the element, which is the target for mouse events, against
@@ -388,7 +395,7 @@ <h2>Extensions to the <a>DocumentOrShadowRoot</a> Mixin</h2>
388395
<a href="https://dom.spec.whatwg.org/#context-object">context object</a> are in the
389396
same tree, otherwise returns null.</p>
390397
<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">
392399
&lt;body&gt;
393400
&lt;div id=&quot;host1&quot;&gt;
394401
&lt;shadow-root id=&quot;root1&quot;&gt;
@@ -416,18 +423,22 @@ <h2>Extensions to the <a>DocumentOrShadowRoot</a> Mixin</h2>
416423
</dl>
417424
</section>
418425

419-
<section>
426+
<section data-dfn-for="MouseEvent">
420427
<h2>Extensions to the <a>MouseEvent</a> Interface</h2>
421428

422429
<p><a>User agent</a>s must extend the MouseEvent interface
423430
[[!UIEVENTS]]
424431
with two members:</p>
425432

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>
431442
</dl>
432443

433444
<p>The members <code>movementX</code> and <code>movementY</code> must
@@ -483,19 +494,23 @@ <h2>Extensions to the <a>MouseEvent</a> Interface</h2>
483494
events when the cursor moves outside the window.</p>
484495
</section>
485496

486-
<section>
497+
<section data-dfn-for="MouseEventInit">
487498
<h2>Extensions to the <a>MouseEventInit</a> Dictionary</h2>
488499

489500
<p><a>User agent</a>s must extend the MouseEventInit dictionary
490501
[[!UIEVENTS]] with two members <code>movementX</code> and
491502
<code>movementY</code> used to initialize respective members
492503
of <code>MouseEvent</code>.</p>
493504

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>
499514
</dl>
500515
</section>
501516

@@ -592,7 +607,7 @@ <h2>Synthetic cursor interaction with HTML DOM UI</h2>
592607
following code should permit a custom cursor to send click events while
593608
the pointer is locked:</p>
594609

595-
<pre class='example highlight' id="example-synthetic-cursor">
610+
<pre class='example' id="example-synthetic-cursor">
596611
document.addEventListener("click", function (e) {
597612
if (e._isSynthetic)
598613
return;

0 commit comments

Comments
 (0)