Skip to content
Browse files

(1) Only target IE6. (2) Don't cache the result of isPngFix() as the …

…caller already gets cached. (3) Don't use a regexp to parse the value. (4) Use PIE.CSS_PREFIX.
  • Loading branch information...
1 parent d8e2f5a commit 6212f97c6ee41f4bd4b98093ce9e7f8df88b24ef Felix Gnass committed with Sep 18, 2010
Showing with 9 additions and 6 deletions.
  1. +9 −6 sources/BackgroundStyleInfo.js
View
15 sources/BackgroundStyleInfo.js
@@ -272,19 +272,22 @@ PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
} ),
/**
- * Tests if style.PiePngFix or the -pie-png-fix property is set to true/on.
+ * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6.
*/
- isPngFix: PIE.StyleInfoBase.cacheWhenLocked( function() {
+ isPngFix: function() {
+ if (PIE.ieVersion > 6) {
+ return false;
+ }
var el = this.targetElement;
- var val = (el.style.PiePngFix || el.currentStyle.getAttribute( 'pie-png-fix' ));
- return /^(true|on)$/i.test(val);
- } ),
+ var val = (el.style.PiePngFix || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ));
+ return val === true || val == 'true';
+ },
/**
* The isActive logic is slightly different, because getProps() always returns an object
* even if it is just falling back to the native background properties. But we only want
* to report is as being "active" if either the -pie-background override property is present
- * and parses successfully or '-pie-png-fix' is set to true/on.
+ * and parses successfully or '-pie-png-fix' is set to true in IE6.
*/
isActive: PIE.StyleInfoBase.cacheWhenLocked( function() {
return (this.getCss3() || this.isPngFix()) && !!this.getProps();

0 comments on commit 6212f97

Please sign in to comment.
Something went wrong with that request. Please try again.