Closed Bug 1723469 Opened 3 years ago Closed 3 years ago

Background image larger than 4096px ignore CSS opacity

Categories

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

Firefox 92
defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- wontfix
firefox90 --- wontfix
firefox91 --- wontfix
firefox92 --- wontfix
firefox93 --- wontfix
firefox94 --- wontfix
firefox95 --- wontfix
firefox96 --- wontfix
firefox97 --- wontfix
firefox98 --- fixed

People

(Reporter: romuald, Assigned: bradwerth)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files, 2 obsolete files)

Attached file HTML example reproducing the issue (obsolete) —

Description

When a CSS element have an image whose background-image is an image larger than 4096 pixels (in height at least), the opacity CSS attribute is somehow ignored.

Any value more than 0.0 will be displayed with an actual opacity of 1.0

  • when using a CSS definition with an image of 4096px height and 0.3 opacity, the opacity correctly displayed
  • when using a CSS definition with an image of 4097px height and 0.3 opacity, the opacity is set to 1.0

I've attached an HTML page showing the issue


Additional information

This is a regression, as this works fine in Firefox 78 (ESR)

This seems to affect all platforms

For some reason, adding a visible text (not space for example) inside the element will circumvent the issue and take the opacity into account

(Actual use case is CSS sprites image whose width / height can be very large)

Included the actual images as data-url as the original ones obviously weren't included >_<

The example can also be found at https://chivil.com/bugs/firefox-background-opacity/

Mozregression says that it's regression from bug 1669840.

Component: General → Graphics: WebRender
Keywords: regression
Product: Firefox → Core
Regressed by: sw-wr-perf-opacity
Has Regression Range: --- → yes

I'll figure out what we can do here. Likely we're hitting some texture limit in WebRender that puts us on a fallback path that handles opacity differently.

Assignee: nobody → bwerth

I would suspect something to do with image tiling?

Status: UNCONFIRMED → NEW
Ever confirmed: true

Hi Brad, any chance to look at this one (and perhaps also triage)?
Thank you!

Flags: needinfo?(bwerth)

Sorry for the lack of action on this. I'll stay on it; just need to complete some other things first.

Severity: -- → S3
Flags: needinfo?(bwerth)
Priority: -- → P3
Flags: needinfo?(bwerth)

:bradwerth is this still a priority?

(In reply to Lougenia Bailey from comment #8)

:bradwerth is this still a priority?

P3 is still appropriate. I have higher-priority bugs assigned to me.

Flags: needinfo?(bwerth)

Hi Brad, any chance we can revisit the priority of this bug? It appears to have picked up a dupe recently and is hitting in the wild.

Flags: needinfo?(bwerth)

Comment on attachment 9234227 [details]
HTML example reproducing the issue

The other reproduction case is self-contained.

Attachment #9234227 - Attachment is obsolete: true

This prevents opacity from being set on large images sent to WebRender.
Instead, opacity will be handled in the parent layer, which is less efficient,
but correct for these large images.

This can be a temporary fix until WR supports opacity on arbitrarily large
images.

Still need to add a test, and a dependent Bug for a better fix within WebRender.

Flags: needinfo?(bwerth)
Blocks: 1752919
Attachment #9261369 - Attachment description: WIP: Bug 1723469 Part 1: Prevent large background images from using opacity flattening. → Bug 1723469 Part 1: Prevent large background images from using opacity flattening.
Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/01e61a4cc0af Part 1: Prevent large background images from using opacity flattening. r=aosmond,emilio https://hg.mozilla.org/integration/autoland/rev/086ba0886b3f Part 2: Add reftest for opacity flattening of large images. r=aosmond,emilio
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

Post-landing comments on https://phabricator.services.mozilla.com/D137360 revealed a flaw that needs patching.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

WebRender doesn't care about CSS scale, so calculate its limits in terms of
the scale it does care about.

Attachment #9261989 - Attachment is obsolete: true
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
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: