Closed Bug 1808232 Opened 1 year ago Closed 7 months ago

3D transform + backface-visibility: hidden breaks backdrop-filter

Categories

(Core :: Graphics: WebRender, defect)

Firefox 110
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: ana.tudor.lhnh, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: correctness)

Attachments

(2 files)

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

Steps to reproduce:

  1. Give an element dimensions & a semitransparent background, while its parent gets a perspective set on it and a background with some sharp separation lines that would make any bluriness applied via a filter obvious:
body {
  perspective: 25em;
  /* a background */
}

div {
  /* dimensions */
  background: hsla(0, 0%, 100%, .35);
}
  1. Set a 3D transform & a backdrop-filter on the element:
transform: rotatey(15deg);
backdrop-filter: blur(5px)

So far, so good - the body backdrop gets blurred behind the 3D rotated element.

But often, we may want something more than just a static rotated element.

We may want a card that rotates on hover and has two different faces, like here https://www.cssscript.com/demo/glassmorphism-credit-card/

Or a glassy looking 3D shape, like here https://codepen.io/thebabydino/pen/yLqJoog/88bd6d750752a9f33efb6be01bf5f7a8 (this was a base test for what a glassy cube like https://dribbble.com/shots/6026036-Glass-blocks would end up looking like in CSS).

This brings us to the next step:

  1. Add backface-visibility: hidden on our element.

Actual results:

This breaks the 3D effect (reported here https://bugzilla.mozilla.org/show_bug.cgi?id=1789055) AND the backdrop-filter: effect (no more blurriness)

Test https://codepen.io/thebabydino/pen/oNMLELr

Expected results:

The 3D effect and the blurriness should have been retained. This is what happens in both Chromium browsers & Safari (the card demo seems broken in Safari, but that's only because backdrop-filter is missing the -webkit- prefix there; adding the prefix from DevTools makes the glassmorphism effect work there too)

Attached image chrome_vs_firefox.png

Screenshot of intended demo result (Chrome) vs. the actual result in Firefox.

Component: Untriaged → Graphics
Product: Firefox → Core
Keywords: correctness
See Also: → 1789055
Component: Graphics → Graphics: WebRender

Confirmed on Windows differences between Firefox and Chrome, as described.
Not a dire issue, but not great, but probably S4.
Over to @gw

Severity: -- → S4
Flags: needinfo?(gwatson)
Flags: needinfo?(gwatson)
Blocks: 1816630

This seems to be working fine now in Firefox 120 (current Nightly). Hit some other problems with backdrop-filter and 3D transforms in the meanwhile and I'll open separate bugs, but this one in particular seems fixed?

Checked now in Firefox 118 too. Looks fine there as well.

2023-10-10T23:19:37.640000: DEBUG : Found commit message:
Bug 1812341 - Fix 3d transforms bug with backface-visibility: hidden r=gfx-reviewers,jrmuizel

Status: NEW → RESOLVED
Closed: 7 months ago
Depends on: 1812341
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: