Closed Bug 1153694 Opened 5 years ago Closed 3 years ago

background-attachment:fixed on scrolled elements causes too much layerization

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox40 --- affected
firefox49 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

This is a regression from bug 1148855.

It can be seen on http://fantasai.inkedblade.net/weblog/ , where the h1 and address elements at the top have a fixed background image. It causes the whole text content of the page to be lifted into a new layer above the one that contains the white background + blue border.

We should detect that the fixed background has a clip with respect to the scrolled content, and not block layer merging for things outside that clip.
Markus, did anything ever happen with this? I encounter this quite a lot when investigating android OOMs. Though not specifically with background-attachment:fixed, just with anything with a different AGR. We often end up doubling our texture usage for the sake of a tiny bit of moving text.

I must admit I'm not really sure how, why, or how often these things are clipped. I fear rarely. But especially in circumstances where there is no clip, we might want to think twice about creating a new layer for an unclipped AGR. The problem is of course it's hard to know half way through a display list what is the right call.
Flags: needinfo?(mstange)
This particular bug hasn't been fixed yet - and it's specifically about background-attachment:fixed.
We can talk about ways to reduce our memory usage on IRC tomorrow, if you want. The current code tries to layerize just as much as is required for correct APZ scrolling.
Flags: needinfo?(mstange)
Attached patch test (obsolete) — Splinter Review
Comment on attachment 8759389 [details]
Bug 1153694 - Don't let nsDisplayFixedPosition cause unnecessary layerization around itself.

https://reviewboard.mozilla.org/r/57394/#review54198
Attachment #8759389 - Flags: review?(matt.woodrow) → review+
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ed35b7de211
Don't let nsDisplayFixedPosition cause unnecessary layerization around itself. r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/0ed35b7de211
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Cool! Not really sure why though. Either I introduced a bug or we were doing something really stupid before.
Assignee: nobody → mstange
Attachment #8759334 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.