Closed Bug 2014986 Opened 1 month ago Closed 1 month ago

Regression in view-transition element capture

Categories

(Core :: CSS Transitions and Animations, defect, P3)

Firefox 149
defect

Tracking

()

VERIFIED FIXED
149 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox147 --- unaffected
firefox148 + verified
firefox149 + verified

People

(Reporter: jakea, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached video Demo of issue

https://deploy-preview-25--wordle-analyzer.netlify.app/ - this is a version of https://wordle-analyzer.com/ with the transitions 100x slower.

Enter two words, eg "soare" and "crane", and hit "analyze".

In nightly, the timing of the capture seems incorrect, and it means the coloured versions of the squares isn't being captured along with their outlined versions.

Sorry, that description sucks. See the video.

With mozregression --good 147 -a https://wordle-analyzer.com/ I get: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=f0508bdfdcef4a7f203806f510d1fa084224aedb&tochange=4dc50e8367a1d9082bc8f8fa8296481ec97a2ba4

I tested with the "fast" site so I'd appreciate a double-check. But it's not impossible if we were not reconstructing before and now we are, somehow.

I got the same commit with mozregression.

Yeah, I can confirm it's caused by that patch. Here's what's going on if you're curious. You have the following DOM:

div@0x7f7be5912ca0 data-index="0" class="_cell_19dwp_10 _correct_19dwp_30 _has-char_19dwp_26" style="grid-column: 1; view-transition-name: guess-cell-0-0;" state=[100820000] flags=[00002000] selectorflags=[00000000] primaryframe=0x7f7be5abd288 refcount=9<
  Text@0x7f7be5906800 flags=[00030000] primaryframe=0x7f7be5ad2230 refcount=3<a>
  span@0x7f7be5920670 class="_sr_6gixq_1" state=[100820000] flags=[00000000] selectorflags=[00000000] primaryframe=(nil) refcount=6<
    Text@0x7f7be5906a80 flags=[00000000] primaryframe=(nil) refcount=2<(>
    Text@0x7f7be5906b00 flags=[00000000] primaryframe=(nil) refcount=2<correct>
    Text@0x7f7be5906b80 flags=[00000000] primaryframe=(nil) refcount=2<)>
  >
>

Where the <span> is display: none and gets dynamically switched to display: block (or something block-outside at least).

The issue is that the "a" text node is wrapped into an anonymous flex item. Before my patch, we computed the insertion point as the parent grid container, which in this case is right. Now we compute it as the child's anon block, and end up reconstructing the whole cell, which loses the capture...

Keywords: regression
Regressed by: 2008148
See Also: → 2015007

Set release status flags based on info from the regressing bug 2008148

The situation this patch deals with is when you have the following frame
tree structure:

ns{Flex,Grid}ContainerFrame
::-moz-anonymous-item
Some text

And you append something after "Some text".

Before the regressing bug, we ended up in different codepaths for
insertion and append: Append always ended with the grid container as a
parent (and the anonymous item as a prev sibling), while insert ended
with the current nightly behavior of choosing the text frame as a
sibling, and the anonymous item as a parent.

WipeContainingBlock has code to deal with the wrong choice, but that
forces the container to be reconstructed, which is inefficient and in
cases like this one has correctness implications (because we store the
"view transition live capture bit" on the frame). I filed bug 2015007
for that since that's technically wrong too.

This is the relatively-minimal upliftable fix to minimize reframes in
both cases, which of course fixes the regression. I think it might be
worth looking into whether we can make the right decision later in the
pipeline (e.g., making WipeContainingBlock override the insertion parent
rather than bailing out). But that seems riskier.

Add a test for the different cases here.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

[Tracking Requested - why for this release]: regression that would be nice not to ship

Severity: -- → S3
Priority: -- → P3
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch

:emilio, please add a beta uplift request when you have a moment

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

firefox-beta Uplift Approval Request

  • User impact if declined: Regression which would be nice not to ship.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: Targetted fix
  • String changes made/needed: none
  • Is Android affected?: yes
Attachment #9543369 - Flags: approval-mozilla-beta?
Flags: qe-verify+

The situation this patch deals with is when you have the following frame
tree structure:

ns{Flex,Grid}ContainerFrame
::-moz-anonymous-item
Some text

And you append something after "Some text".

Before the regressing bug, we ended up in different codepaths for
insertion and append: Append always ended with the grid container as a
parent (and the anonymous item as a prev sibling), while insert ended
with the current nightly behavior of choosing the text frame as a
sibling, and the anonymous item as a parent.

WipeContainingBlock has code to deal with the wrong choice, but that
forces the container to be reconstructed, which is inefficient and in
cases like this one has correctness implications (because we store the
"view transition live capture bit" on the frame). I filed bug 2015007
for that since that's technically wrong too.

This is the relatively-minimal upliftable fix to minimize reframes in
both cases, which of course fixes the regression. I think it might be
worth looking into whether we can make the right decision later in the
pipeline (e.g., making WipeContainingBlock override the insertion parent
rather than bailing out). But that seems riskier.

Add a test for the different cases here.

Original Revision: https://phabricator.services.mozilla.com/D282161

Attachment #9543369 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [uplift] [qa-ver-needed-c149/b148]

I was able to reproduce the issue in Nightly 149.0a1 (2026-02-06) on macOS 15. Verified as fixed in the latest Nightly 149.0a1 (2026-02-09) and in Firefox 148.0b13 on macOS 15, Ubuntu 22.04 and Windows 10 where the issue is no longer present. Updating the flags accordingly.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift] [qa-ver-needed-c149/b148] → [uplift] [qa-ver-done-c149/b148]
Flags: qe-verify+
QA Contact: epopescu
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: