-
Notifications
You must be signed in to change notification settings - Fork 0
[css-view-transitions-1] Rearrange algorithms, add notes #3
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
Conversation
css-view-transitions-1/Overview.bs
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed this. It used to be "update transition DOM", but it's doing more than that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
|
|
||
| Note: This algorithm captures the current state of the document, | ||
| calls the transition's {{UpdateCallback}}, | ||
| then captures the new state of the document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note is new.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new
| 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]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new
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.