[mediacapture-fromelement] Inconsistency: Taint, not mute cross-origin element tracks (#83)

jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-fromelement:

== Inconsistency: Taint, not mute cross-origin element tracks ==
It seem clear from [§5. Security Considerations](https://w3c.github.io/mediacapture-fromelement/#security-considerations) element capture expressly supports tainted tracks: _"Media elements can render media resources from origins that differ from the origin of the media element. In those cases, the contents of the resulting MediaStreamTrack MUST be protected from access by the document origin._

_How this protection manifests will differ, depending on how the content is accessed. For instance, **rendering inaccessible video to a canvas element [2DCONTEXT] causes the origin-clean property of the canvas to become false**; attempting to create a Web Audio MediaStreamAudioSourceNode [WEBAUDIO] succeeds, but produces no information to the document origin (that is, **only silence is transmitted into the audio context**); attempting to **transfer the media using WebRTC [WEBRTC] results in no information being transmitted**. "_

Closed issues like https://github.com/w3c/mediacapture-fromelement/issues/70 also support this reading.

However, HTMLMediaElement's [captureStream](https://w3c.github.io/mediacapture-fromelement/#dom-htmlmediaelement-capturestream) algorithm appears to suggest implementations should _mute_ rather than taint output: _"At any time, a media element **might not have active content available** for capture on a given track for a variety of reasons: ... 4. The contents of the track might become inaccessible to the current origin due to cross-origin protections. ... **Absence of content** is reflected in captured tracks through the muted attribute. A captured **MediaStreamTrack MUST have a muted attribute set to true if its corresponding source track does not have available and accessible content**."_

Muting seems like a mistake, contradicts §5, and AFAIK nobody implements this.

Firefox [taints the track correctly](https://jsfiddle.net/jib1/cwzdtpgk/), and Chrome [used to](https://bugs.chromium.org/p/chromium/issues/detail?id=761622).

cc @martinthomson 

Please view or discuss this issue at https://github.com/w3c/mediacapture-fromelement/issues/83 using your GitHub account

Received on Friday, 6 December 2019 19:28:14 UTC