[Webkit-unassigned] [Bug 29365] New: Background images not freed when changing CSS classes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 18 02:46:10 PDT 2009


           Summary: Background images not freed when changing CSS classes
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: j at dna.ie

If css is defined as follows:

.bg1 {
 background-image: url(img1.jpg);

.bg2 {
 background-image: url(img2.jpg);

And then you change the background on an element using:

    document.getElementById('pagebg').className = "bg1";
    document.getElementById('pagebg').className = "bg2";

The "old" image reference is not freed up. (Use of cache has been disabled)

If I change the image background using 

    document.getElementById('pagebg').style.backgroundImage = 'url(img1.jpg)';
    document.getElementById('pagebg').style.backgroundImage = 'url(img2.jpg)';

The old image reference is correctly freed up.

I have put up pages to illustrate this behaviour:

The first use case (which caches the image) is at:

The 2nd use case is at:

(In both pages the image loads/transitions are triggered by a key press)

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list