#439: Autoplay Detection: async vs sync API
Discussions
Comment by @torgo Nov 5, 2019 (See Github)
Tentatively put this down for a discussion at our next f2f (1st week of December). Please let us know if you need feedback sooner than that.
Comment by @hober Dec 5, 2019 (See Github)
Hi,
We looked at this issue in our Cupertino F2F. We agree that the Design Principles document needs to be updated to cover nuanced cases like these. We've filed w3ctag/design-principles#145 to track that update.
We think, in this case, the API should be synchronous, due to many factors that have already been captured in the minutes of the Media WG session at Fukuoka, and in our minutes today (which I will link here once they're posted), namely:
- An async API would unnecessarily complicate the work of web developers (and while this may enable particular implementation strategies, the Priority of Constituencies favors web developers over browser engineers),
- A sync API is more predictable and would not have timing issues (such as when you create a promise during a user gesture and resolve it outside of that gesture).
Comment by @annevk Dec 5, 2019 (See Github)
Hmm, but we're changing the way user gestures are done so that short-lived asynchronous work is no longer problematic. Was that taken into account?
OpenedNov 1, 2019
Hello TAG!
I'm requesting the TAG express an opinion on a dispute related to:
Explanation of the issue that we'd like the TAG's opinion on:
The group is divided with regards to the interpretation of the Client-side API Design Principles, in particular section 2.8 regarding asynchronous vs synchronous APIs when put against the HTML Design Principles, in particular 3.2 Priority of Consistencies.
The context of the problem is fairly simple: UAs would like to expose the autoplay policy currently used by the page to allow them to make some early decisions for their user experience The question is whether it should be exposed as
document.getAutoplayPolicy()
returning aPromise<AutoplayPolicy>
ordocument.autoplayPolicy
returningAutoplayPolicy
.Links to the positions of each side in the dispute (e.g., specific github comments):
Chrome would like for the API to be asynchronous because:
async
, the cost of an asynchronous API is small especially given that the solutions implemented by web pages today are asynchronous in nature (load a resource)Mozilla & Apple would like the API to be synchronous because:
What steps have already been taken to come to an agreement:
The issue has been discussed on GitHub, during an informal offsite on the side of FOMS NYC and at TPAC. We believe that the best solution at this point is for the TAG to clarify its design principles as this is the core of the issue. All parties would be happy to follow the TAG recommendations.
We'd prefer the TAG provide feedback as (please select one):