[css-view-transitions-1] Rearrange algorithms, add notes - #3
[css-view-transitions-1] Rearrange algorithms, add notes#3jakearchibald wants to merge 2 commits into
Conversation
| Issue: Define the algorithm used to clip the snapshot when it exceeds max size. | ||
| </div> | ||
|
|
||
| ## [=Handle transition frame=] ## {#update-transition-dom-algorithm} |
There was a problem hiding this comment.
Renamed this. It used to be "update transition DOM", but it's doing more than that.
|
|
||
| Note: This algorithm captures the current state of the document, | ||
| calls the transition's {{UpdateCallback}}, | ||
| then captures the new state of the document. |
| 1. [=Capture the old state=] for |transition|. | ||
|
|
||
| If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=], | ||
| and return. |
There was a problem hiding this comment.
This used to be inline, but the algorithm was getting a bit large. This felt like a unit that could be moved to its own sub-algorithm.
| 1. [=Capture the new state=] for |transition|. | ||
|
|
||
| If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=], | ||
| and return. |
There was a problem hiding this comment.
Another bit that used to be inline, but now moved into its own algorithm.
| 1. [=Resolve=] |transition|'s [=ViewTransition/ready promise=]. | ||
| </div> | ||
|
|
||
| ### [=Capture the old state=] ### {#capture-old-state-algorithm} |
There was a problem hiding this comment.
I've groups some algorithms with a parent algorithm, if they're only ever called by the parent. This gives us a more hierarchical heading structure.
| </div> | ||
|
|
||
| 1. Set |document|'s [=document/transition suppressing rendering=] to true. | ||
| ### [=Capture the new state=] ### {#capture-new-state-algorithm} |
There was a problem hiding this comment.
This is just extracted from the "Setup view transition" algorithm. No changes other than returning failure, rather than throwing an error.
| Issue: The link for "paint order" doesn't seem right. | ||
| Is there a more canonical definition? | ||
| <div algorithm> | ||
| To <dfn>setup transition pseudo-elements</dfn> for a {{ViewTransition}} |transition|: |
There was a problem hiding this comment.
This is just moved. No changes, aside from those noted.
| Would it be simpler to always add it and try to optimize in the implementation? | ||
| </div> | ||
|
|
||
| ## [=Call the update callback=] ## {#call-dom-update-callback-algorithm} |
There was a problem hiding this comment.
Not changed, just moved.
|
|
||
| Note: The |interestRectangle| is the subset of |element|'s [=ink overflow rectangle=] that should be captured. | ||
| This is required for cases where an element's ink overflow rectangle needs to be clipped because of hardware constraints. | ||
| For example, if it exceeds the maximum texture size. |
There was a problem hiding this comment.
Moved this note to the "computing the interest rectangle" algorithm
| Note: This algorithm constructs the pseudo-element tree for the transition, | ||
| and generates initial styles. | ||
| The structure of the pseudo-tree is covered at a higher level in [[#view-transition-pseudos]]. |
| Note: This is guaranteed to happen for every {{ViewTransition}}, | ||
| even if the transition is [=Skip the view transition|skipped=]. | ||
| The reasons for this are discussed in [[#transitions-as-enhancements]]. |
93388ed to
4782752
Compare
e4cdc46 to
c97c2d9
Compare
Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
I moved some algorithms around, as such the diff is trash, sorry. I'll try and make it easier to read in the comments.
Don't merge this. I'll move it to the CSSWG when #2 lands.