Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CaptureController an EventTarget #9

Closed
fred-wang opened this issue May 12, 2023 · 8 comments
Closed

Make CaptureController an EventTarget #9

fred-wang opened this issue May 12, 2023 · 8 comments

Comments

@fred-wang
Copy link
Contributor

See https://dom.spec.whatwg.org/#eventtarget

The extension in the spec is:

partial interface CaptureController {
  attribute EventHandler oncapturedmousechange;
};

I see interfaces with similar interfaces with similar onsomething EventHandler attribute derive from EventTarget but not sure whether that's something that is a requirement or even just that we consider interesting here.

@eladalon1983
Copy link
Contributor

Are you aware of precedents of an extension spec introducing inheritance?

@fred-wang
Copy link
Contributor Author

Are you aware of precedents of an extension spec introducing inheritance?

That does not seem possible:

"Note: A partial interface definition cannot specify that the interface inherits from another interface. Inheritance is to be specified on the original interface definition."

https://webidl.spec.whatwg.org/#dfn-partial-interface

@fred-wang
Copy link
Contributor Author

@eladalon1983 For now the solutions I have in mind are:

  1. Get this inheritance change accepted in the Screen Capture directly.
  2. Introduce a separate class deriving from EventTarget and exposing on* events. This class would be exposed as a new attribute of CaptureController, or alternatively it could inherit from CaptureController and passed as an option to getDisplayMedia (but not sure this would work).

@eladalon1983
Copy link
Contributor

eladalon1983 commented May 16, 2023

Short-term, let's redefine CaptureController in our spec as inheriting from EventTarget. (That is, not use partial, but say that we're redefining it outright.) Will you send a PR to that effect?

Long-term, let's try to get this accepted in the Screen Capture spec. I'll start the discussion. (Edit: I've filed w3c/mediacapture-screen-share/issues/268 and w3c/mediacapture-screen-share/issues/269 and asked for a time slot to discuss this during the June interim of the WebRTC WG, which manages the spec where CaptureController is defined.)

@fred-wang fred-wang changed the title Should CaptureController be an EventTarget? Make CaptureController an EventTarget May 17, 2023
fred-wang added a commit to fred-wang/mouse-events that referenced this issue May 17, 2023
- 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.
fred-wang added a commit to fred-wang/mouse-events that referenced this issue May 17, 2023
- 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.
@fred-wang
Copy link
Contributor Author

@eladalon1983 OK, I submitted a first PR here: #10 ; will work on the constructor stuff in a separate PR

fred-wang added a commit to fred-wang/mouse-events that referenced this issue May 27, 2023
- 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.
@eladalon1983
Copy link
Contributor

Frédéric, do you mind if I close this issue now?

@fred-wang
Copy link
Contributor Author

@eladalon1983 OK when #10 is merged :-) and then we can close issue #1 too

@fred-wang
Copy link
Contributor Author

Oh nevermind, we actually don't need to specify inheritance on partial interfaces. I already had removed that from PR #10...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants