Open Bug 1313757 Opened 9 years ago Updated 7 months ago

background-clip: text does not work well with background-attachment: fixed

Categories

(Core :: Layout: Text and Fonts, defect, P3)

48 Branch
defect

Tracking

()

Tracking Status
firefox57 --- fix-optional

People

(Reporter: lanny, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50 Steps to reproduce: Used background-clip: text and background-attachment: fixed on the same element to see the background image stay still as the backgrounded text scrolls by Actual results: Strange behavior. On the site I'm developing, the entire element showed the background, instead of just the text, as though background-clip didn't work at all. In the example file I'm attaching, the text itself acts like it is position: fixed; instead of the background being fixed. Expected results: The text should scroll by, and you should see the background remain motionless behind it
Blocks: 1247777
Component: Untriaged → Layout: Text
Flags: needinfo?(jeremychen)
Version: 49 Branch → 48 Branch
It's about background-text:clip. I will check it.
Assignee: nobody → cku
Flags: needinfo?(jeremychen)
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Blocks: 1264905
Also if set `background-size` to `cover` then background fills entire rectangle
CJ, would you be able to get back to looking at this at all? (Looking briefly at your WIP from last year, I suspect the issue with it -- the reason it was only a partial fix -- is really about async scrolling rather than directly an e10s/non-e10s issue. It's just that async scrolling is only used when e10s is enabled. The code in nsDisplayBackgroundImage has changed since then but I think the patch could be updated fairly easily; but offhand I don't know what is needed to make it work with APZ.)
Flags: needinfo?(cku)
Priority: -- → P3
Assignee: cku → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(cku)

Are there any updates regarding this?

I just upgraded to Firefox 71.0 on the Mac and I am still seeing this issue. I would like to remove the workaround my site has specifically to handle firefox.

Flags: needinfo?(jfkthame)
Blocks: 759568
Flags: needinfo?(jfkthame)

(Screenshot taken in Firefox 78.0.2 at Windows 10, 1dppx resolution. Outcome in Nightly from 2020-07-14 is identical.)

bug 1543117 is even better report of presumably same issue, with most excellent testcase (but it's bug page seems nag infested).

Currently there are several famous CSS demos that unintentionally exhibits this bug, last one encountered is Adam Argyle's CSS Fixed Conic Fill (it has non-conic gradient fallback that sadly fails on this very exact bug) and perhaps this one by Valerii Ladomyriak.

There is also bug 1545128 that exhibits somehow similarly strange behaviour of background-clip: text - this time in conjunction with transform.

Couldn't be that complex to fix this, right?

Severity: normal → S3

This is still a problem in 2024. Simplified test case I made before doing a search here made this bug pop up.

I hit it while coding a swipe theme switcher (attached video) with no content duplication. This theme switcher relies on using fixed gradient backgrounds (simplified version illustrating the idea). When there is enough text content to scroll, I hit this bug in Firefox.

It looks like this is an invalidation problem. When you click the text or unfocus the window it paints properly.

It looks like this is an invalidation problem. When you click the text or unfocus the window it paints properly.

For me just unfocussing the window or only clicking at the text is not enough; to force proper repaint I have to select the text content (where it really is, not where its "ghost" is shown at the moment), or switch to other tab and return back. (This is actually creepily amusing, since it feels like ghost that moves only when I am not looking, or turns visible only when grasped :].)

I talked with mstange about this and we came to the conclusion that only reasonable way forward is switch to using a WebRender mask for the background and have WebRender scroll things properly. We should be able to add the text mask to the clip.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: