mozilla-b2g/gaia — pull request #6897 by davidflanagan (2012-12-07 21:16:13+00:00)
Title: Bug 809782 - remove background-image for offscreen thumbnails

This pull request dramatically decreases gallery memory usage when there are many images in the gallery by no setting the background-image style of thumbnail elements that are not visible. If there are 1000 images on the phone, I expect this patch to make the gallery process 40mb leaner.

The changes to the gallery app itself are small. The interesting code is in shared/js/visibility_monitor.js which tracks the scrolling list of thumbnails to and calls callbacks when they go on and off screen.