Re: [csswg-drafts] [css-view-transitions-1] Should the DOMChangeCallback be posted as a task from skip transition steps? (#7904)

Summary from offline discussion. Microtasks need a checkpoint to ensure they run before a specific event. Since there is already a checkpoint for [Web Animations](https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events:~:text=Perform%20a%20microtask%20checkpoint), using a microtask will ensure the callback runs before the next rAF. It is brittle to rely on an unrelated checkpoint for this timing though.

Also since the callback itself is async, it's already possible that it hasn't finished before the next rAF. The [domUpdated](https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-domupdated) promise was added precisely so developers have a hook to know when the callback is done. That could be used to delay queueing another transition if it should deterministically start after the callback for the first one is done.

**Proposed Resolution**: [Invoking the dom-update-callback](https://drafts.csswg.org/css-view-transitions-1/#skip-the-page-transition-algorithm:~:text=If%20transition%E2%80%99s%20phase%20is%20before%20%22%60dom%2Dupdate%2Dcallback%2Dcalled%60%22%2C%20then%20call%20the%20DOM%20update%20callback%20of%20transition.) is done by positing a task in skip the page transition.

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


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

Received on Tuesday, 25 October 2022 23:52:56 UTC