Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

@chrisdavidmills chrisdavidmills commented Nov 27, 2025

Summary

Chrome and Safari have both supported view transition types (see https://chromestatus.com/feature/5089552511533056) for a while, so it is high time I got them documented on MDN.

Having checked BCD, it seems that we have pretty much all of the data we need in place already, but I wanted to improve the Document.startViewTransition() data:

  1. Originally, the method only took one parameter, a callback function.
  2. It then got updated so that it can either take the callback function, or an options object containing the callback function as a property, plus a types array as a property.
  3. The current data has two sub-data points:
    a. updateCallback makes sense — this is the callback parameter mentioned in 1.
    b. callbackOptions doesn't make sense. This refers to a mixin in the spec that represents the possible parameter values as one item. This is a spec construct and not a real value that developers can use. It would be better to have a sub-data point for the options object, with sub-sub-data points for the possible object properties. This last bit is maybe not totally necessary, but I thought it would be useful for developers who are specifically checking the compat table for types support.

This PR updates the data as described above, and also updates the spec URLs so they all point to the Level 2 of the spec

Test results and supporting details

Related issues

@github-actions github-actions bot added data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:m [PR only] 25-100 LoC changed labels Nov 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, but the nested parameters should not be nested according to BCD guidelines.

Comment on lines +8418 to +8420
"types_property": {
"__compat": {
"description": "`types` property",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BCD guidelines suggest to not nest these:

Suggested change
"types_property": {
"__compat": {
"description": "`types` property",
"options_types_parameter": {
"__compat": {
"description": "`options.types` parameter",

Copy link
Contributor

@caugner caugner Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @ddbeck Is this a special case warranting an exception? (I don't remember understanding why we don't nest these.)

Edit: Nesting has the benefit of linting the child support data against the parent support data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not nesting them seems a little odd to me.

Comment on lines +8454 to +8456
"update_property": {
"__compat": {
"description": "`update` property",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"update_property": {
"__compat": {
"description": "`update` property",
"options_update_parameter": {
"__compat": {
"description": "`options.update` parameter",

@github-actions github-actions bot added data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML labels Dec 8, 2025
@chrisdavidmills
Copy link
Contributor Author

chrisdavidmills commented Dec 8, 2025

As an FYI, I've updated the Firefox support for these updates to "preview": see https://bugzilla.mozilla.org/show_bug.cgi?id=2001878.

Update: After more testing, I'm pretty sure it should just be "147", not "preview". There doesn't appear to be a pref to flip for this.

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

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants