Closed Bug 2051358 Opened 2 months ago Closed 1 month ago

Borders show stripe artifacts at certain zoom levels when clipped by a rounded container

Categories

(Core :: Graphics: WebRender, defect)

Firefox 153
defect

Tracking

()

VERIFIED FIXED
154 Branch
Tracking Status
firefox154 --- verified
firefox155 --- verified

People

(Reporter: betauploader3, Assigned: nical)

References

Details

(Keywords: perf-alert)

Attachments

(7 files)

Attached file border-test.html

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

Steps to reproduce:

User Agent

Firefox 153.0b5

Firefox Nightly (current)


Expected Results

CSS borders should render uniformly at all page zoom levels without introducing additional stripe patterns or artifacts, as in Firefox 152.


Actual Results

In Firefox 153 and current Nightly builds, borders may display visible stripe artifacts at certain zoom levels when they are clipped by a rounded container.

Horizontal borders show vertical dark segments, while vertical borders show horizontal dark segments. The number and spacing of these artifacts vary depending on the current zoom level and scaling factor.

Removing overflow: hidden from the parent container, or setting border-radius to 0, prevents the issue.

This behavior does not occur in Firefox 152 and may indicate a rendering regression affecting border rendering under scaling when rounded clipping is involved.


Steps to Reproduce

  1. Create a new, clean Firefox profile.
  2. Open the attached reduced test case.
  3. Zoom the page in and out.

Observed behavior:

  • At certain zoom levels, the border displays repeated stripe artifacts perpendicular to the border direction.
  • The artifacts disappear at other zoom levels.
  • Removing overflow: hidden from the parent container, or setting border-radius to 0, eliminates the problem.

Reproducible zoom levels:

  • With layout.css.devPixelsPerPx = 1.0:

    • 50%
    • 70%
    • 90%
    • 110%
    • 150%
  • With layout.css.devPixelsPerPx = 1.25:

    • 50%
    • 70%
    • 100%
    • 120%
    • 130%

Additional Notes

  • The issue reproduces on a clean profile using the attached minimal test case.
  • The same test case renders correctly in Microsoft Edge (Chromium).
  • Firefox 152 does not exhibit this behavior, suggesting a regression in Firefox 153 or later.
  • The parent container does not need overflowing content. In the testcase, overflow: hidden is used to apply rounded clipping, and the child element stays within the parent bounds.
  • The problem affects all borders, although using transparency makes the stripe patterns easier to observe.
  • This may affect websites and browser UI components that use rounded clipping together with borders.
  • This may be related to Bug 2051177, which also started in Firefox 153 and affects inset box-shadow rendering under scaling, although this testcase uses standard CSS borders instead of box-shadows.

Firefox 153 under the same test conditions. Visible horizontal and vertical stripe artifacts appear inside the border near all four corners.

Settings:

  • layout.css.devPixelsPerPx = 1.25
  • Page zoom = 130%

Firefox 152 under identical test conditions. The border renders uniformly without any visible stripe artifacts.

Settings:

  • layout.css.devPixelsPerPx = 1.25
  • Page zoom = 130%

The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, but is not confident enough to move the bug to that component.

Component: Untriaged → General
Status: UNCONFIRMED → NEW
Component: General → Graphics: WebRender
Ever confirmed: true
Product: Firefox → Core
Severity: -- → S3
Flags: needinfo?(nical.bugzilla)

The incorrect overlap was happening because with axis-aligned transforms we assume that non-antialiased quads exactly cover thir render task, meaning that the bounds of the indirect prim are the same as the bounds of the primitive that composites it. However the composite quad was more conservative (it was always rounded out to allow potential antialiasing pixels) so there was a mismatch whoch this patch addresses.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Flags: needinfo?(nical.bugzilla)

This one was caused by add_pattern_prim doing an intersection between the rounded clip rect and the non-rounded local rect, which undid the rounding in some situations. The fix is to do the intersection earlier before rounding the clip rect.

An inefficiency that went unnoticed until a test with fractional scaling showed some odd seams in a solid border.

Regressions: 2055902
Regressions: 2056021
Regressions: 2056191
QA Whiteboard: [qa-ver-opt-c155/b154][qa-triage-done-c155/b154]
Regressions: 2057970

Perfherder has detected a talos performance change from push 9d3cec6ffc71f3e1659210135bc7415bdacc7d6d.

No action is required from the author; this comment is provided for informational purposes only.

Improvement Test Platform Options Absolute values [old vs new]
3% tresize (doc) linux1804-64-shippable-qr e10s fission nova stylo webrender 22.62 ms -> 22.00 ms

Need Help or Information?

If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

Keywords: perf-alert

Reproducible on a 2026-06-29 Firefox Nightly build on Windows 10.

Verified as fixed on Firefox Nightly 155.0a1 and Firefox 154.0b10 on Windows 10, macOS 13, Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-ver-opt-c155/b154][qa-triage-done-c155/b154] → [qa-ver-done-c155/b154][qa-triage-done-c155/b154]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: