OpenLayers OpenLayers

Ticket #1520 (closed bug: fixed)

Opened 5 months ago

Last modified 2 months ago

Util.modifyAlphaImageDiv makes hidden elements reappear in IE6.

Reported by: openlayers Assigned to: jwpage@gmail.com
Priority: minor Milestone: 2.7 Release
Component: Util Version: SVN
Keywords: Cc: jwpage@gmail.com
State: Complete

Description

Platform: IE6 OS: Windows XP

Calling the modifyAlphaImageDiv and runs the alphaHack, which currently sets the style.display to "inline-block". It should leave the style.display alone, if it is "none".

For example, calling Icon.setUrl() calls Icon.draw() which in turn calls Util.modifyAlphaImageDiv(). Doing this in Firefox will leave a hidden icon alone, but trying IE6 results in the icon reappearing.

marker = new OpenLayers.Marker(...);
markers.addMarker(marker);
marker.display(false);
marker.setUrl(...);
// Icon reappears in IE6 but remains hidden in Firefox and IE7.

Example of bug in action is here: http://johnsonpage.org/trunklayers/examples/marker-test.html

Attachments

modifyalphaimagediv.patch (2.3 kB) - added by openlayers on 04/17/08 00:44:46.
Patch to leave display:none imageDivs alone.
patch-1520-r7537.diff (0.9 kB) - added by pgiraud on 07/17/08 11:13:37.

Change History

04/17/08 00:44:46 changed by openlayers

  • attachment modifyalphaimagediv.patch added.

Patch to leave display:none imageDivs alone.

04/17/08 00:45:54 changed by openlayers

  • state set to Review.

04/25/08 06:49:16 changed by crschmidt

  • milestone changed from 2.6 Release to 2.7 Release.

05/31/08 13:11:25 changed by crschmidt

  • status changed from new to closed.
  • state changed from Review to Complete.
  • resolution set to fixed.

(In [7299]) Fix for "Util.modifyAlphaImageDiv makes hidden elements reappear in IE6.". Patch by jwpage. (Closes #1520)

06/05/08 11:43:55 changed by tschaub

  • status changed from closed to reopened.
  • resolution deleted.

Please run tests while reviewing. There are 21 tests in the test_Util_modifyAlphaImageDiv function. In addition, "inline-block" is not a style display value in CSS2 - and is *not* supported in Firefox 2.

06/05/08 11:45:03 changed by tschaub

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [7308]) correcting the test count and not running the test for inline-block where alpha hack doesn't apply (closes #1520)

07/17/08 10:59:29 changed by pgiraud

  • status changed from closed to reopened.
  • resolution deleted.

I still don't think that the number of tests is correct. In the following statement, we have 2 tests in the if block vs. 3 for the else block :

        if (OpenLayers.Util.alphaHack()) {
        
            var filter = "progid:DXImageTransform.Microsoft" +
                         ".AlphaImageLoader(src='" + img + "', " +
                         "sizingMethod='" + sizing + "') alpha(opacity=" + opacity *100 + ")";
            t.eq(imageDiv.style.filter, filter, "div filter value correctly set");

            filter = "alpha(opacity=0)";
            t.eq(image.style.filter, filter, "image filter set correctly");

        } else {
            t.eq( image.src, img, "image.style.backgroundImage correctly");    
            t.ok(true, "div filter value not set (not in IE)");
            t.ok(true, "image filter value not set (not in IE)");
        }

07/17/08 11:13:37 changed by pgiraud

  • attachment patch-1520-r7537.diff added.

07/17/08 11:14:46 changed by pgiraud

  • state changed from Complete to Review.

The attached patch fixes the tests failure in IE6. Please review.

07/17/08 11:21:27 changed by tschaub

  • state changed from Review to Commit.

Thanks for the catch pgiraud. Not running tests, but I trust you've got it right now. Good riddance to this ticket.

07/17/08 11:23:51 changed by pgiraud

  • status changed from reopened to closed.
  • state changed from Commit to Complete.
  • resolution set to fixed.

(In [7538]) the number of tests were wrong while launched in IE6, r=tschaub (Closes #1520)