Closed Bug 1629011 Opened 4 years ago Closed 4 years ago

3D transforms on an element that is the child of a <button> with transform-style: preserve-3d makes the element disappear

Categories

(Core :: Web Painting, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla77
Tracking Status
firefox-esr68 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- verified

People

(Reporter: m+mozilla, Assigned: mikokm)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

On this demo : https://codepen.io/aaroniker/full/bGVGNrV the icons aren't shown up. It works on chrome.

You can follow the slack discussion here: https://devtools-html.slack.com/archives/C3VTFTCBY/p1586513103082200

This might be a bug for the Layout or Graphics teams.

What points to a bug with 3D transforms is that if you disable these transforms, the icons show up:

.button {
-  will-change: transform;
-  -webkit-transform-style: preserve-3d;
-  transform-style: preserve-3d;
-  -webkit-transform: perspective(440px) rotateX(calc(var(--rx, 0) * 1deg)) rotateY(calc(var(--ry, 0) * 1deg)) translateZ(0);
-  transform: perspective(440px) rotateX(calc(var(--rx, 0) * 1deg)) rotateY(calc(var(--ry, 0) * 1deg)) translateZ(0);
}
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Untriaged → Layout
Product: Firefox → Core
Attachment #9139747 - Attachment mime type: text/plain → text/html
Attached file testcase.html

An even more reduced test case, which confirms this is a Firefox bug.

This seems like the combination of the following:

  • transform-style: preserve-3d; on the parent
  • that parent is a <button> element (doesn't happen with <div>)
  • the child has a 3D transform on it (even a dummy one like translateZ(0) or rotateZ(0))
Attachment #9139747 - Attachment is obsolete: true

The testcase renders fine on Safari and Chromium.

Summary: 3D transforms bug → 3D transforms on an element that is the child of a <button> with transform-style: preserve-3d makes the element disappear
Component: Layout → Web Painting
Has Regression Range: --- → yes
Keywords: regression
Version: 77 Branch → unspecified
Component: Web Painting → Graphics: Layers
Flags: needinfo?(matt.woodrow)

Hi Matt, do you have some more details on how you were able to narrow this down to the Graphics component?

Flags: needinfo?(matt.woodrow)

I'm changing my mind actually, I looked at the wrong bug from the regression range.

The regressing bug 1359709, made it so that we use the parent DOM element to decide if a transformed frame should be included in a preserve-3d context, instead of the parent layout frame.

The <button> element creates an anonymous block frame around its children, so previously the transform-style:preserve-3d would have had no effect, and now it does.

That said, it shouldn't actually break, so I guess there's a bug in how we build the display list in this case.

Miko, do you have any time to look at this?

Component: Graphics: Layers → Web Painting
Flags: needinfo?(matt.woodrow) → needinfo?(mikokm)
Assignee: nobody → mikokm
Status: NEW → ASSIGNED
Flags: needinfo?(mikokm)
Pushed by mikokm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/5d161b0edb1b
Recurse into block wrappers when marking preserve-3d frames for display list building r=mattwoodrow
Regressed by: 1359709

Comment on attachment 9142090 [details]
Bug 1629011 - Recurse into block wrappers when marking preserve-3d frames for display list building r=mattwoodrow

Beta/Release Uplift Approval Request

  • User impact if declined: Web compatibility issue with CSS transforms.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Open attachment 9139754 [details], correct rendering should show a blue square in the button.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small self-contained patch with test
  • String changes made/needed:
Attachment #9142090 - Flags: approval-mozilla-beta?
Flags: qe-verify+

This is a very old regression, and the patch affects more stuff than buttons, like IB splits... Why do you want it uplifted Tim?

Comment on attachment 9142090 [details]
Bug 1629011 - Recurse into block wrappers when marking preserve-3d frames for display list building r=mattwoodrow

It's late in the cycle for 76 and this is a very old issue. Let's let this ride 77 to release so it can get some more bake time.

Attachment #9142090 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Priority: -- → P2
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
QA Whiteboard: [qa-triaged]

Reproduced the issue on MacOS 10.15 and Windows 10 using Firefox 75.0 (20200403170909) and Firefox 76.0b7 (20200421231527)
Verified fixed on Firefox Nightly 77.0a1 (20200422214848)

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: