Re: [csswg-drafts] [css-view-transitions-1] domUpdated isn't the right term (#8144)

Posting a summary of all the options brought up on the issue so folks can quickly skim through and pick the one they most agree with.

- Option 1 builds on `domUpdated`: "Updated" is the verb to indicate state has changed and "dom" is the noun to refer to this state.

   For the prefix we want something which encompasses any update to the DOM (node state, tree state, computed style, loading state, canvas update etc). The options are:
   - `stateUpdated` : state can be a bit generic.
   - `viewUpdated` : We landed on "view" transitions with the idea that the transition is between the user visible "views" of the page. Since the callback doesn't change visuals for the user, view can be ambiguous.
   - `renderingUpdated` : Similar to above, rendering hasn't been updated when this promise resolves.
   - `nodeTreeUpdated` : Doesn't encompass all the ways in which the page state can change.
   - `targetUpdated` : Follows the nomenclature of source and target views to refer to new page state as "target". Not great since the spec has settled on old and new views for this.

   There are a few other options for the suffix too:
   - `domReady` : We already have a "ready" promise to indicate the pseudo-DOM has been generated.
   - `domChanged`
   - `domMutated`
   - `domUpdateHandled` : Don't see the advantage of this vs domUpdated, its just longer.
   - `domChangeHandled` : Same as above.

- Option 2 is to tie the promise to the callback passed by the developer in startViewTransition. The callback is currently named `UpdateDOMCallback` and the promise will `updateDOMCallbackDone` or `updateDOMCallbackHandled`. So it seems like we still need a noun + verb combination as the options above.

   A related options is to skip the noun. So you'd just have `updateCallback` (see verb options for update above) and the promise will be callback name + "done/handled", like `updateCallbackDone` or `updateCallbackHandled`.

Please add in case I missed something.

---

My take is that the pattern for nounVerbCallback for the callback and nounVerb for the promise is good. And `update` is fine for the verb. The discussion started with avoiding the use of "dom" as the noun. And from the options above, I'd go with state. It's generic but intentionally so since we want to encompass a broad type of updates. So, `updateStateCallback` and `stateUpdated`.

If we can't agree on a noun then next best option is to drop it and go with `updateCallback` and `updateCallbackDone`.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8144#issuecomment-1373865788 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 6 January 2023 16:27:59 UTC