WICG / audio-focus

Other
21 stars 11 forks source link

"must invoke its pause() method" #23

Open xxyzzzq opened 7 years ago

xxyzzzq commented 7 years ago

From @annevk on June 15, 2015 11:18

https://mediasession.spec.whatwg.org/#indefinitely-pause

must invoke its pause() method

We should not invoke public methods from prose as they can be overridden by script. Please instead invoke the algorithm pause() invokes directly. This might involve filing a bug on the relevant specification to give that algorithm a name.

Copied from original issue: WICG/mediasession#65

xxyzzzq commented 7 years ago

From @annevk on June 15, 2015 11:20

This also applies to the play() method.

xxyzzzq commented 7 years ago

From @foolip on June 15, 2015 11:49

https://html.spec.whatwg.org/#internal-pause-steps kind of works, but there's nothing for play().

xxyzzzq commented 7 years ago

From @richtr on June 17, 2015 7:30

In the conformance section we say the following:

When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that e.g. the author can’t change the behavior by overriding attributes or methods with custom properties or functions in JavaScript.

Does this not cover your concern? I agree it would be good to give internal algorithms names. I will file a bug for this.

xxyzzzq commented 7 years ago

From @annevk on June 17, 2015 8:40

That kind of wording is a hack imo. We shouldn't rely on it long term.