Closed Bug 2080185 Opened 1 month ago Closed 1 month ago

Image is scaled up and down while scrolling the page

Categories

(Core :: Graphics: WebRender, defect)

Firefox 158
defect

Tracking

()

VERIFIED FIXED
160 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox158 --- wontfix
firefox159 --- verified
firefox160 --- fixed

People

(Reporter: mirh, Assigned: gw)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 2 external files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:158.0) Gecko/20100101 Firefox/158.0

Steps to reproduce

I was scrolling https://www.phoronix.com/news/Linux-Hibernation-With-Lockdown

Actual results

The small Tux icon "jumps" up and down (it seems like smooth scrolling decides it has to be longer or shorter by a few pixels every few frames). This is most apparent when using the smallest interval that autoscroll still accepts.

Expected results

The image stays then and there consistent

:gw, since you are the author of the regressor, bug 2070683, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)
Component: Untriaged → SVG
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: SVG → Graphics: WebRender

WebRender moves display items out of the pre-scrolled coordinates Gecko
authors them in by the accumulated external scroll offset, and snaps them
there, re-applying the scroll offset rounded to whole device pixels. The
raster size was picked by rounding the pre-scrolled rect, so for a rect with
a fractional device extent it depended on the sub-pixel phase of the scroll
offset while the rect it is drawn into did not. Since bug 2070683 draws a
texture that is a pixel off 1:1 instead of stretching it, every repaint
during a scroll could alternate between the two sizes and visibly change
the image's shape.

Read the offset back from the WebRender display list builder, so it is the
same accumulation it normalizes with, and round there instead. This also
stops scrolling from requesting a new raster size for such images.

image-scrolled-fractional-raster-1 encoded the old behaviour, a raster a row
taller than the snapped rect drawn 1:1 and clipped; the raster now matches
the snapped rect.

Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Flags: needinfo?(mozilla)
Attachment #9657395 - Attachment description: Bug 2080185 - Pick image raster sizes at the scroll-invariant position WebRender snaps at r?#gfx-reviewers → Bug 2080185 - Pick image raster sizes at the scroll-invariant position WebRender snaps at

:gw anything stopping this from landing? would be good to get into beta if we want it for the next dot release for 158.

Flags: needinfo?(mozilla)

(In reply to Dianna Smith [:diannaS] from comment #4)

:gw anything stopping this from landing? would be good to get into beta if we want it for the next dot release for 158.

It was waiting on review overnight - that has happened now so I have pushed it to lando.

Flags: needinfo?(mozilla)
Pushed by gwatson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/74591af1535c https://hg.mozilla.org/integration/autoland/rev/c69c7211d15d Pick image raster sizes at the scroll-invariant position WebRender snaps at r=gfx-reviewers,nical
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch

The patch landed in nightly and beta is affected.

:gw, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox159 to wontfix if the fix can wait for the next release.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Visual glitches in some DPI ratios and some images
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: Per bug report
  • Risk associated with taking this patch: low
  • Explanation of risk level: Small patch
  • String changes made/needed?: No
  • Is Android affected?: yes
Attachment #9659631 - Flags: approval-mozilla-beta?
Flags: qe-verify+

WebRender moves display items out of the pre-scrolled coordinates Gecko
authors them in by the accumulated external scroll offset, and snaps them
there, re-applying the scroll offset rounded to whole device pixels. The
raster size was picked by rounding the pre-scrolled rect, so for a rect with
a fractional device extent it depended on the sub-pixel phase of the scroll
offset while the rect it is drawn into did not. Since bug 2070683 draws a
texture that is a pixel off 1:1 instead of stretching it, every repaint
during a scroll could alternate between the two sizes and visibly change
the image's shape.

Read the offset back from the WebRender display list builder, so it is the
same accumulation it normalizes with, and round there instead. This also
stops scrolling from requesting a new raster size for such images.

image-scrolled-fractional-raster-1 encoded the old behaviour, a raster a row
taller than the snapped rect drawn 1:1 and clipped; the raster now matches
the snapped rect.

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

Flags: needinfo?(mozilla)
Attachment #9659631 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [uplift][qa-ver-needed-c160/b159]

I could not reproduce the issue on Ubuntu24.04 and Win11x64 using Firefox builds 158.0 and 158.0a1(20260916202159), and the link from description.
mirh@protonmail.ch, is there something else I can do in order to reproduce this and confirm the fix? or you can confirm it on your side? Thank you.

Flags: needinfo?(mirh)
QA Contact: mchiorean

:gw did you want to uplift this to release or let it ride the trains with 159?

Flags: needinfo?(mozilla)

I still see it on 159.0b2, on W10.

Flags: needinfo?(mirh)

The beta uplift will land in 159.0b3, so it's expected you won't see the fix until that build.

The patch does graft cleanly on to 158 but I think we will leave it to ride the trains, unless anyone objects strongly - it's one of those fixes I'd prefer to let sit in a nightly / beta for a little while to ensure it doesn't regress anything else.

Flags: needinfo?(mozilla)

Yes beta 3 is fine, thank you.

Marking as verified on Beta 159.0b3 based on comment#16.

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

Attachment

General

Creator:
Created:
Updated:
Size: