Skip to content

Commit

Permalink
Refine description of when CapturedMouseEvent events are dispatched
Browse files Browse the repository at this point in the history
- Make CaptureController an EventTarget (screen-share#9), temporarily redefining
  it until this is done in the "Screen Capture" spec. Also align the
  way oncapturedmousechange is specified with similar EventHandler
  attributes from the "Media Capture and Streams" spec (i.e. by
  referring to an event type).
- Elaborate in the CapturedMouseEvent section the way events are
  dispatched on CaptureController objects associated to a
  capture-session, defining a new capturedmousechange type for them.
  Also move there the requirements about when to fire the event.
  • Loading branch information
fred-wang committed May 27, 2023
1 parent 26f3ae2 commit 91d27cf
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ <h2>CapturedMouseEvent interface</h2>
more scrutiny in which information may safely be exposed. At present, only information
already available to the capturing application is exposed - the mouse coordinates.
</p>
<p>
For any <a data-cite="screen-capture/#dfn-capture-session">capture-session</a>
that has an associated {{CaptureController}}, events with type
<dfn>capturedmousechange</dfn>, which do not bubble, which are not
cancelable and which use the {{CapturedMouseEvent}} interface, MUST be
regularly dispatched on this {{CaptureController}} to indicate any
move of the captured cursor within the [=display surface=] associated
to that capture-session, or whether the captured cursor entered/exited
that surface.
</p>
<p>Events MUST NOT be fired more than 30 times per second.</p>
<p>
Events MUST NOT be fired after the last clone of the original video track is stopped.
</p>
<pre class="idl">
[Exposed=Window]
interface CapturedMouseEvent : Event {
Expand Down Expand Up @@ -151,26 +165,32 @@ <h2>CapturedMouseEventInit dictionary</h2>
</section>
<section id="capture-controller-extensions">
<h2>CaptureController Extensions</h2>
<p>
We redefine {{CaptureController}} to enable developers to listen to
{{CapturedMouseEvent}} events dispatched by the
<a data-cite="screen-capture/#dfn-capture-session">capture-session</a>:
</p>
<pre class="idl">
partial interface CaptureController {
[Exposed=Window, SecureContext]
interface CaptureController : EventTarget {
constructor();
undefined setFocusBehavior(CaptureStartFocusBehavior focusBehavior);
attribute EventHandler oncapturedmousechange;
};
</pre>
<dl data-link-for="CaptureController" data-dfn-for="CaptureController">
<dt>
<dfn>oncapturedmousechange</dfn>
<dfn>oncapturedmousechange</dfn> of type {{EventHandler}}
</dt>
<dd>
<p>
We extend {{CaptureController}} with {{CaptureController/oncapturedmousechange}}, an
{{EventHandler}} for events of type {{CapturedMouseEvent}}.
</p>
<p>Events MUST NOT be fired more than 30 times per second.</p>
<p>
Events MUST NOT be fired after the last clone of the original video track is stopped.
</p>
<p>The event type of this event is {{capturedmousechange}}</p>
</dd>
</dl>
<div class="issue" data-number="9">
Ideally the Screen Capture spec should define {{CaptureController}}
as an {{EventTarget}} so that we can just define a partial interface
here.
</div>
</section>
</body>
</html>

0 comments on commit 91d27cf

Please sign in to comment.