Closed Bug 1596086 Opened 5 years ago Closed 5 years ago

linear-gradient rendering issue

Categories

(Core :: Graphics: WebRender, defect, P3)

70 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox-esr68 --- wontfix
firefox70 --- wontfix
firefox71 --- wontfix
firefox72 --- fixed

People

(Reporter: bonbons, Assigned: nical)

References

(Regression, )

Details

(Keywords: correctness, regression)

Attachments

(7 files)

Attached image actual rendering (deleted) —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Navigate a page using CSS linear-gradient as page background.
Using a non-fresh Firefox profile - currently only seen under Windows.

CSS background property:
body {
background: #ffffff url(/media/images/bg.jpg) repeat-x;
background: #ffffff linear-gradient( 180deg, #214055 0, #274965 3.5em, rgba(0,0,0,0) 0);
background-repeat: repeat-x;
}

Actual results:

The linear gradient is rendered without respecting size indications. The rendering looks like the gradient area was stretched vertically to vertically fill the viewport height (e.g. when scrolling down the incorrect background stops at the page content position corresponding to 1 viewport height.

Only some browser profiles are affected.
Resetting the browser profile fixes the issue.

Expected results:

The linear gradient should be rendered correctly.

Attached image Expected rendering (deleted) —
Attached file Troubleshooting information (deleted) —

Note: rendering in Firefox's screenshot helper is correct on affected machine.

Setting gfx.webrender.force-disabled to true on an affected firefox instance (and restarting Firefox) lets the gradient be rendered correctly again.

Component: Untriaged → Layout
Product: Firefox → Core

Sounds like a webrender bug, given comment 3.

Component: Layout → Graphics: WebRender

Nical, do you know why this might be?

Blocks: wr-71
Flags: needinfo?(nical.bugzilla)
Priority: -- → P3

(In reply to Jessie [:jbonisteel] plz needinfo (PTO until Dec 3) from comment #5)

Nical, do you know why this might be?

Not yet but it looks like the issue is in WebRender and not in the display list.

It appears to not be restricted to page backgrounds, but also any div when two gradient stops are at offset 100% (offset 1.0 in WR's display list).

This yaml test case inspired from the original one lets you reproduce the issue in wrench directly.

---
root:
  items:
    - type: gradient
      bounds: 50 50 500 500
      start: 0 0
      end: 0 100
      stops: [0.0, blue, 1.0, red, 1.0, green]

My understanding is that we should see a large green rectangle below a blue-to-red gradient but we see red instead.

Assignee: nobody → nical.bugzilla

This issue only happens with the gradient fast path which doesn't support hard stops and seems to detect them incorrectly.

Flags: needinfo?(nical.bugzilla)
Attached file Bug 1596086 - Add a reftest. (deleted) —
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/57869dbf0a8b Detect hard gardient stops using offsets instead of colors. r=gw https://hg.mozilla.org/integration/autoland/rev/00ccdb940ea2 Add a reftest. r=gw https://hg.mozilla.org/integration/autoland/rev/ab2e0e2a9048 Adjust reftest expectations after gradient fix in WebRender. r=kvark
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/db3785d7c430 Detect hard gardient stops using offsets instead of colors. r=gw https://hg.mozilla.org/integration/autoland/rev/3a6f8c6edf4e Add a reftest. r=gw https://hg.mozilla.org/integration/autoland/rev/ad8db62e810c Adjust reftest expectations after gradient fix in WebRender. r=kvark

After applying logical reasoning and science I can only say that I guess a piece of the infra caught the flu. The wrench error says it fails to parse the added reference image but previous try runs and landings didn't have any problem with it and the commit adding the image hasn't changed since.
It also loads fine locally.

Flags: needinfo?(nical.bugzilla)

Try push (unchanged) didn't have the wrench bustage (except for the hg sparse checkout error that's been intermittently happening for a while), So I relanded this as is. https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=278088811&revision=41133fc3a4090b3eb2015bed76536b90a4890880

Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e4f0b7088d50 Detect hard gardient stops using offsets instead of colors. r=gw https://hg.mozilla.org/integration/autoland/rev/756b46d418e0 Add a reftest. r=gw https://hg.mozilla.org/integration/autoland/rev/56e8f613024a Adjust reftest expectations after gradient fix in WebRender. r=kvark
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Has Regression Range: --- → yes
Has STR: --- → yes
OS: Unspecified → All
Regressed by: 1533236
Hardware: Unspecified → All
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: