Closed Bug 1996457 Opened 6 months ago Closed 6 months ago

"position: relative" disables "background-clip: text" on pseudoelements

Categories

(Core :: Web Painting, defect)

Firefox 145
defect
Points:
1

Tracking

()

VERIFIED FIXED
146 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox144 --- unaffected
firefox145 --- verified
firefox146 --- verified

People

(Reporter: cutecurlycoral, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, regressionwindow-wanted, Whiteboard: [anchorpositioning:m2], [wptsync upstream])

Attachments

(3 files)

Attached image woie.png

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

Steps to reproduce:

  1. Create an element
  2. Add text to it, apply background-clip: text
  3. Add a pseudoelement (::before, ::after) as a background (z-index: -1)

Here is the text CSS:

.bug {
width: 100px;
height: 100px;
background-color: aqua;
color: transparent;
background-clip: text;
position: relative;
}

.bug::before {
background-color: blueviolet;
content: '_';
position: absolute;
z-index: -1;
width: 100px;
height: 100px;
}

My Firefox:
Application Basics

Name: Firefox
Version: 145.0b6
Build ID: 20251024094404
Distribution ID:
Update Channel: aurora
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
OS: Windows_NT 10.0 26200

It also happens on mobile Nightly from Play Market

Actual results:

The background-clip stops working

Expected results:

The clipped text should overlay the pseudoelement, as it's always done in the past

The Bugbug bot thinks this bug should belong to the 'Core::Web Painting' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Web Painting
Product: Firefox → Core

Forgot to mention in the reproduction steps:
2. Add text to it, apply background-clip: text, and apply position: relative

Unsure as to how to edit my description.

Can you upload the html file you are using as a testcase here as an attachment?

Flags: needinfo?(cutecurlycoral)
Attached file bug.html

both elements should look identical. They look fine on Firefox release 144.0 and chrome latest

Flags: needinfo?(cutecurlycoral)

(In reply to Timothy Nikkel (:tnikkel) from comment #3)

Can you upload the html file you are using as a testcase here as an attachment?

I've uploaded an example 👍

Blocks: background-clip-text
No longer blocks: 1990448
Keywords: regression
Regressed by: 1990448

Placeholder frames are leaves so they were always skipped for text
masks. This is a bit weird but alas, matches previous behavior and other
browsers.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: -- → S3
Whiteboard: [anchorpositioning:triage]

Set release status flags based on info from the regressing bug 1990448

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/55710 for changes under testing/web-platform/tests
Whiteboard: [anchorpositioning:triage] → [anchorpositioning:triage], [wptsync upstream]
Points: --- → 1
Whiteboard: [anchorpositioning:triage], [wptsync upstream] → [anchorpositioning:m2], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch

Do we want to uplift this if there is still time?

Flags: needinfo?(emilio)

Comment on attachment 9522830 [details]
Bug 1996457 - Keep skipping out of flows for background-clip: text. r=tnikkel,#layout

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Regression that would be nice not to ship.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): One liner that restores previous behavior
  • String changes made/needed: none
  • Is Android affected?: Yes
Flags: needinfo?(emilio)
Attachment #9522830 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Attachment #9522830 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c146/b145] [qa-ver-needed-c146/b145]

Reproduced the issue in Beta 145.0b7 and Nightly 146.0a1 (2025-10-28). Verified - Fixed in Beta 145.0b8 and the latest Nightly build 146.0a1(2025-10-30).

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c146/b145] [qa-ver-needed-c146/b145] → [qa-triage-done-c146/b145] [qa-ver-done-c146/b145]
Flags: qe-verify+
QA Contact: ailea
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: