Closed Bug 2035734 Opened 4 months ago Closed 4 months ago

Box shadow renders incorrectly

Categories

(Core :: Graphics: WebRender, defect)

Firefox 151
defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox150 --- unaffected
firefox151 --- fixed
firefox152 --- fixed

People

(Reporter: HaitraMysh, Assigned: gw)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

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

Steps to reproduce:

When using a display scaling of 125%, the box shadow may render incorrectly. A thin border appears on the right and bottom edges of the box, as shown in the attached image. The issue disappears at some zoom levels when zooming a page in or out.

A reproduction can be seen here: https://jsfiddle.net/HaitraMysh/any0hpf5/

This behavior started occurring in Firefox 151 beta. Using the mozregression tool, I traced the issue to this changeset: https://phabricator.services.mozilla.com/D289944

The problem does not occur in other browsers.

Actual results:

Box shadow rendered incorrectly.

Expected results:

Box shadow should render correctly.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core

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

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)

create_quad_primitive rounds prim_rect in device space, but
element_offset_rel_prim and dest_rect_offset were computed against the
un-rounded prim_rect.min. The shader reconstructs absolute positions
from the rounded local_prim_rect.p0, shifting the analytical element
clip by up to half a device pixel and producing a one-pixel seam on
trailing edges at fractional device coordinates.

Assignee: nobody → mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(mozilla)
Pushed by csabou@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d3e663928dc9 https://hg.mozilla.org/mozilla-central/rev/e2122ca36f94 Align box-shadow analytical clip with rounded prim_rect r=gfx-reviewers,nical
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

The patch landed in nightly and beta is affected.
:gw, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)
Flags: needinfo?(mozilla)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Visual artifacts on box-shadows at some zoom levels
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Small patch
  • String changes made/needed?: No
  • Is Android affected?: yes
Attachment #9584310 - Flags: approval-mozilla-beta?

create_quad_primitive rounds prim_rect in device space, but
element_offset_rel_prim and dest_rect_offset were computed against the
un-rounded prim_rect.min. The shader reconstructs absolute positions
from the rounded local_prim_rect.p0, shifting the analytical element
clip by up to half a device pixel and producing a one-pixel seam on
trailing edges at fractional device coordinates.

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

Attachment #9584310 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: