Re: [csswg-drafts] Proposal: shared element transitions (#6464)

The CSS Working Group just discussed `Shared Element Transitions`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Shared Element Transitions<br>
&lt;khush> For the upcoming press.<br>
&lt;chris>  https://docs.google.com/presentation/d/15y60zFddT859VHKNeH6bjJyrZ1wIr8W7VUfRfr-icIk/edit#slide=id.p<br>
&lt;fantasai> khush: Going to use a very simple example<br>
&lt;dbaron> (khush explained that he sent it to www-archive but it's waiting for approval)<br>
&lt;fantasai> [slide 2]<br>
&lt;fantasai> khush: ...<br>
&lt;fantasai> khush: Core design in both states<br>
&lt;fantasai> khush: what to highlight new CSS attribute callled page transitions tag<br>
&lt;fantasai> khush: During transition we create alternate representation of DOM after snapshotting<br>
&lt;fantasai> khush: Page tells us which parts to shapshot as independent pieces<br>
&lt;fantasai> khush: This is saying root element should also be captured<br>
&lt;fantasai> khush: Other apect is properties that are changing<br>
&lt;fantasai> [slide 3]<br>
&lt;fantasai> khush: This slide shows box tree during transition<br>
&lt;fantasai> khush: have root stacking context, author dom underneath<br>
&lt;fantasai> khush: during transition we create tree of pseudo-elements that is sibling of root stacking context<br>
&lt;dbaron> github: https://github.com/w3c/csswg-drafts/issues/6464<br>
&lt;fantasai> khush: highlight fact that this transition stacking context, it paints as a sibling of the root context<br>
&lt;fantasai> khush: reason is, these content elements are displaying images from author dom<br>
&lt;fantasai> khush: it's displaying root stacking context<br>
&lt;fantasai> khush: inintially tried to place n top layer, but ran into circular dependencies<br>
&lt;fantasai> khush: wanted to capture other elements in top layer<br>
&lt;fantasai> khush: so put it in an independent stacking context as sibling of root<br>
&lt;fantasai> [slide 4]<br>
&lt;fantasai> khush: on the left dom structure, on the right stylesheet from UA<br>
&lt;fantasai> khush: focus on container element<br>
&lt;fantasai> khush: we have layout computed properties for each element with a page-transition tag<br>
&lt;fantasai> khush: and we have transform that maps into ?? space<br>
&lt;fantasai> khush: UA that generates, box renders at same spot that renders in author DOM<br>
&lt;fantasai> khush: Last is z-index for paint ordering<br>
&lt;fantasai> khush: we compute that anduse z-index to paint in same order in peudo tree<br>
&lt;fantasai> khush: container get us box that maps to actual element's box<br>
&lt;fantasai> khush: content fo element comes from ??? proeprties<br>
&lt;fantasai> khush: Using element in CSS to get a painted representation of the DOM element's contents<br>
&lt;vmpstr> s/???/old-content and new-content/<br>
&lt;fantasai> khush: this is a snapshot of element in the new dom<br>
&lt;fantasai> khush: the old one is snapshot of old content with cacehed element<br>
&lt;fantasai> khush: we cache a static paint to retain the content of the old dom<br>
&lt;fantasai> khush: then DOM changed to new state<br>
&lt;fantasai> [slide 5]<br>
&lt;fantasai> khush: Previous slide showed transition pseudo element tree and how to make it look like author dom<br>
&lt;fantasai> khush: this shows the animations shoing change from old to new state<br>
&lt;fantasai> khush: first animates box from old size andposition to new size and position<br>
&lt;fantasai> khush: for the content just do a swap, old content fadesin / new content fades out<br>
&lt;fantasai> khush: because of all the pseudo elements exposed to developer, can customize any way they want<br>
&lt;vmpstr> [slide 6]<br>
&lt;fantasai> khush: this slide meant to highlight the ...<br>
&lt;fantasai> khush: want to approximate the rendering as much as possible<br>
&lt;fantasai> khush: issue with inherited properties<br>
&lt;fantasai> khush: won't retain inherited from ancestors, but will  ...<br>
&lt;fantasai> khush: When generating snapshot, doesn't include any effects from ancestors<br>
&lt;fantasai> khush: Everything with a page-transition tag paitns in ame orderin pseudo-element treee<br>
&lt;fantasai> khush: but if element ?? wasn't tagged, then its content is in the root element image<br>
&lt;astearns> s/.../retain positioning and screen space transforms/<br>
&lt;fantasai> khush: and this will cause a paint order change<br>
&lt;fantasai> khush: Last is the liveness of DOM, old DOM is static, but new dom is live-updated<br>
&lt;fantasai> khush: By design; that's how element() function works today<br>
&lt;smfr> next silde<br>
&lt;fantasai> [slide 7]<br>
&lt;fantasai> khush: list of spec changes<br>
&lt;fantasai> khush: First is to update the element() spec<br>
&lt;fantasai> khush: right now element() generates an element that is size of element's bounding box<br>
&lt;fantasai> khush: ink overflow is getting lcipped<br>
&lt;fantasai> fantasai: don't think you can include the ink overflow<br>
&lt;fantasai> fantasai: because then size of image is unpredictable<br>
&lt;fantasai> fantasai: and ink overflow is potentially infinite, and where it gets clipped will vary by implementation<br>
&lt;TabAtkins> scribe+ TabAtkins<br>
&lt;fantasai> s/unpredictable/unpredictable, and can't be accurately positioned by the author/<br>
&lt;fantasai> khush: Next is stnadardizing the pseudo-element tree<br>
&lt;fantasai> khush: so need to spec that<br>
&lt;fantasai> khush: then need to define new stacking context for transitions<br>
&lt;fantasai> khush: and because of ink overflow, need to define that replaced element can overflow its box<br>
&lt;fantasai> khush: blending pixels, have a proposal to allow that<br>
&lt;fantasai> khush: Right now actively implementing this<br>
&lt;fantasai> khush: want to get feedback in WICG on issues like fantasai raised<br>
&lt;fantasai> khush: as implementation matures will discuss issues<br>
&lt;fantasai> astearns: Suggest participating in repo, would like to get this feature right<br>
&lt;fantasai> astearns: On the call want to discuss if any serious concerns with the direction being proposed<br>
&lt;fantasai> smfr: Various limitations in escaping ancestor effects like opacity and filters<br>
&lt;fantasai> smfr: makes me think people will write pages ...<br>
&lt;fantasai> smfr: pop out of ancestor opacity and then nmove<br>
&lt;fantasai> smfr: seems limitation of implementation, only snapshotting things and not the whole tree?<br>
&lt;fantasai> khush: 2 additions<br>
&lt;fantasai> khush: right now snapshotting the whole element<br>
&lt;fantasai> khush: but added a mode where only snapshottong ?? and keep decorations and other things<br>
&lt;fantasai> khush: the other mode also snapshots highlighting etc. (????)<br>
&lt;fantasai> khush: Want to get there, but incrementally<br>
&lt;fantasai> khush: can point to explainer<br>
&lt;fantasai> khush: don't have issue of ancestor effects not being preserved<br>
&lt;fantasai> smfr: Showed pseudo-element hierarchy<br>
&lt;fantasai> smfr: you're snapshotting old content<br>
&lt;fantasai> smfr: using speudo-elements to define animations<br>
&lt;fantasai> smfr: but no DOM node behind that<br>
&lt;fantasai> khush: Once cached the state, need to be able to represent<br>
&lt;fantasai> khush: to get the rendering to look like author DOM, we made a tree of pseudo-elements<br>
&lt;fantasai> smfr: There are some similarities with things like animation-worklet<br>
&lt;fantasai> smfr: where you have a little JS world where you are limited in what you can do, but this is a little different<br>
&lt;fantasai> khush: Because pseudo-elements, limits in what you can do<br>
&lt;fantasai> khush: e.g. introducing own notes in tree or changing structure of tree<br>
&lt;fantasai> khush: getting to work with those requests is difficult<br>
&lt;fantasai> khush: limitations are defined here by what you can do with pseudo-elements<br>
&lt;fantasai> khush: so you can change their style, but not their structure<br>
&lt;fantasai> khush: can animate using CSS animations<br>
&lt;fantasai> smfr: can you apply arbitrary properties?<br>
&lt;fantasai> khush: yes<br>
&lt;fantasai> smfr: so you are running layout on the tree<br>
&lt;fantasai> khush: WE had cases where box aspect ratio was changing, wanted not to stretch but to clip, so set 'object-fit' and it just work<br>
&lt;fantasai> smfr: when p-e tree is showing, is it sitting on top and cans ee document underneath?<br>
&lt;fantasai> khush: in UA stylesheet we set 'visibility: hidden' on elements with page-transition tag<br>
&lt;fantasai> khush: don't actually show the page content, but still there<br>
&lt;fantasai> khush: if changing small part of page, don't put page-transition tag on the root<br>
&lt;fantasai> khush: so that keeps showing new DOM<br>
&lt;fantasai> khush: but see the transitions  on top of it<br>
&lt;fantasai> smfr: ?????<br>
&lt;fantasai> khush: ....<br>
&lt;fantasai> khush: and then we save the hierarchy as well<br>
&lt;astearns> s/?????/is the old page content a snapshot?/<br>
&lt;astearns> s/..../yes/<br>
&lt;smfr> is the old page content a snapshot<br>
&lt;fantasai> smfr: so if page content has animation, that will freeze<br>
&lt;fantasai> khush: yes<br>
&lt;fantasai> khush: new DOM is live, but old DOM is frozen<br>
&lt;fantasai> astearns: Suggest putting links to the specific parts of explainer/issue that respond to the things discussed here<br>
&lt;fremy> just in general, I think this is a very interesting proposal<br>
&lt;fantasai> jensimmons: Also helpful to have resources to explain author experience<br>
&lt;fantasai> khush: The explainer takes an example of one page, and has the author CSS that you need to get the transition working. I'll link to that section also<br>
&lt;fantasai> astearns: Fine to put Agenda+ either on this meta-issue or adding a new issue, to discuss particular parts of this proposal<br>
&lt;fantasai> astearns: would rather do that than doing general discussion again<br>
&lt;fantasai> astearns: Thanks very much for presentation, very cool stuff.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6464#issuecomment-988985028 using your GitHub account


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

Received on Wednesday, 8 December 2021 16:46:56 UTC