If root element doesn't take the viewport height, view transition snapshot gets stretched.
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox140 | --- | fixed |
People
(Reporter: emilio, Assigned: boris)
References
(Blocks 1 open bug)
Details
(Whiteboard: [viewtransitions:m2])
Attachments
(2 files)
This can be seen in https://mdn.github.io/dom-examples/view-transitions/spa/, which works if you add :root { height: 100vh } or so.
Boris not sure if this happens to be fixed by the snapshot containing block changes? If not I can look into it.
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #0)
This can be seen in https://mdn.github.io/dom-examples/view-transitions/spa/, which works if you add
:root { height: 100vh }or so.Boris not sure if this happens to be fixed by the snapshot containing block changes? If not I can look into it.
It's unfortunate my patch doesn't help this bug. It may be a different bug or I missed something.
| Assignee | ||
Comment 3•1 year ago
|
||
We can easily reproduce this in the test. It seems we use the wrong height for ImageFrame, for root. The height of e1 looks normal.
| Assignee | ||
Comment 4•1 year ago
|
||
(In reply to Boris Chiou [:boris] from comment #3)
Created attachment 9484862 [details]
testcaseWe can easily reproduce this in the test. It seems we use the wrong height for
ImageFrame, forroot. The height ofe1looks normal.
The frame tree (in CSS pixels) of view-transition-image-pair(root):
AbsoluteList@101a8e000 <
Block(div)(0)@101b375c0 parent=101b37478 (x=0, y=0, w=1024, h=722.5) [content=109d0d540][cs=109823308][:view-transition-image-pair] <
line@101b37a18 count=2 state=inline,clean,prevmarginclean,not-impacted,not-wrapped,no-break,clear-before:none,clear-after:none(x=0, y=0, w=0, h=0) <
Placeholder(div)(0)@101b37810 parent=101b375c0 next=101b37998 (x=0, y=0, w=0, h=0) [content=109d0d5d0][cs=1098cc308][:-moz-oof-placeholder] outOfFlowFrame=ImageFrame(div)(0)@101b37708
Placeholder(div)(1)@101b37998 parent=101b375c0 (x=0, y=0, w=0, h=0) [content=109d0d660][cs=1098cc308][:-moz-oof-placeholder] outOfFlowFrame=ImageFrame(div)(1)@101b37890
>
AbsoluteList@101a8e020 <
ImageFrame(div)(0)@101b37708 parent=101b375c0 next=101b37890 (x=0, y=0, w=1024, h=230) [content=109d0d5d0][cs=109823708][:view-transition-old]
ImageFrame(div)(1)@101b37890 parent=101b375c0 (x=0, y=0, w=1024, h=230) [content=109d0d660][cs=109823a08][:view-transition-new]
>
>
>
We can see that the height of the container (i.e. ::view-transition-image-pair) looks correct, but the height of ImageFrame (i.e. ::view-transition-new and ::view-transition-old) is stretched.
Also, after I added :root { height: 100vh }, the frame tree (in CSS pixels) looks like:
AbsoluteList@109e3dc20 <
ImageFrame(div)(0)@101b35708 parent=101b355c0 next=101b35890 (x=0, y=0, w=1024, h=722.5) [content=109d0d5d0][cs=109823d08][:view-transition-old]
ImageFrame(div)(1)@101b35890 parent=101b355c0 (x=0, y=0, w=1024, h=722.5) [content=109d0d660][cs=109818308][:view-transition-new]
>
The height is matched to ::view-transtion-image-pair(root).
| Assignee | ||
Comment 5•1 year ago
|
||
Yap. I know what happened. We use the wrong size for root in some places.
| Assignee | ||
Comment 6•1 year ago
|
||
It seems we forgot to use the size of snapshot containing block when
capturing the root element. Refactor the code a little bit to make sure
we do the check every time.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 8•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Updated•1 year ago
|
Description
•