Permalink
Browse files

Rework isPngFix method to use STYLE_PREFIX constant, prevent strange …

…error when uncompressed, and reduce code size. Add testcase.
  • Loading branch information...
1 parent 828dac6 commit 0c6f888aea61c6bd272124305a28fd2c6201d933 Jason Johnston committed Oct 31, 2010
Showing with 37 additions and 10 deletions.
  1. +10 −10 sources/BackgroundStyleInfo.js
  2. +27 −0 tests/png-fix.html
@@ -271,16 +271,16 @@ PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty );
} ),
- /**
- * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6.
- */
- isPngFix: function() {
- if (PIE.ieVersion > 6) {
- return false;
- }
- var el = this.targetElement;
- var val = (el.style.PiePngFix || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ));
- return val === true || val == 'true';
+ /**
+ * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6.
+ */
+ isPngFix: function() {
+ var val = 0, el;
+ if( PIE.ieVersion < 7 ) {
+ el = this.targetElement;
+ val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' );
+ }
+ return val;
},
/**
View
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <title>Tests that VML boxes are sized exactly as the main element</title>
+
+ <style>
+
+
+ #test1 {
+ position: relative;
+ -pie-png-fix: true;
+ background: url(icon-ie.png);
+ behavior: url(../build/PIE.htc);
+ padding: 2em;
+ }
+
+
+
+ </style>
+</head>
+<body>
+
+ <div id="test1" class="test">test 1</div>
+
+</body>
+</html>

0 comments on commit 0c6f888

Please sign in to comment.