"position: relative" disables "background-clip: text" on pseudoelements
Categories
(Core :: Web Painting, defect)
Tracking
()
| 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)
|
6.40 KB,
image/png
|
Details | |
|
1.32 KB,
text/html
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Steps to reproduce:
- Create an element
- Add text to it, apply background-clip: text
- 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
Comment 1•6 months ago
|
||
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.
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.
Comment 3•6 months ago
|
||
Can you upload the html file you are using as a testcase here as an attachment?
both elements should look identical. They look fine on Firefox release 144.0 and chrome latest
(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 👍
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 6•6 months ago
|
||
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 7•6 months ago
|
||
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.
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 8•6 months ago
|
||
Set release status flags based on info from the regressing bug 1990448
Updated•6 months ago
|
Comment 11•6 months ago
|
||
| bugherder | ||
Comment 12•6 months ago
|
||
Do we want to uplift this if there is still time?
| Assignee | ||
Comment 13•6 months ago
|
||
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
| Assignee | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 14•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 16•6 months ago
|
||
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).
Description
•