Skip to content

[css-shared-element-transitions-1] Should createDocumentTransition take an init dictionary or a callback #7827

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

Closed
vmpstr opened this issue Oct 4, 2022 · 3 comments

Comments

@vmpstr
Copy link
Member

vmpstr commented Oct 4, 2022

Currently the shared element transition spec says that createDocumentTransition (modulo any renames in #7788) should take a dictionary, with currently a single member: updateDOM.

Since updateDOM is a necessary, or at least a very commonly needed callback, should the signature instead be
createDocumentTransition(callback) and then if needed we can extend that to createDocumentTransition(callback, initDictionary)?

@jakearchibald

@vmpstr vmpstr added the css-view-transitions-1 View Transitions; Bugs only label Oct 4, 2022
@khushalsagar
Copy link
Member

I have a mild preference for createDocumentTransition(callback, initDictionary). The non-optional parameter followed by an optional dictionary. This matches the element.animate(keyframes, options) syntax too.

@jakearchibald
Copy link
Contributor

Related whatwg/webidl#1191

@khushalsagar
Copy link
Member

Discussed this offline today and the conclusion was that createDocumentTransition(callback) is the simpler and preferable syntax. So proposed resolution: "createDocumentTransition takes a callback".

@jakearchibald if I'm reading the whatwg issue right, we want to make callback and dictionaries indistinguishable. So we'd eventually be able to change the API to take a dictionary and the existing code (which passes a callback) would still work. So the above resolution is good for when we eventually have more options to switch to a dictionary?

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

No branches or pull requests

3 participants