Permalink
Browse files

CSS: Fix get upper case alpha opacity in IE8

Fixes gh-1705
Closes gh-1704
  • Loading branch information...
mescoda authored and mgol committed Nov 8, 2014
1 parent 3f9fda8 commit c5e8e12cef31fee89965891669ecdca6436be319
Showing with 21 additions and 1 deletion.
  1. +1 −1 src/css.js
  2. +7 −0 test/data/testsuite.css
  3. +13 −0 test/unit/css.js
View
@@ -22,7 +22,7 @@ var
// BuildExclude
getStyles = curCSS.getStyles,
ralpha = /alpha\([^)]*\)/i,
- ropacity = /opacity\s*=\s*([^)]*)/,
+ ropacity = /opacity\s*=\s*([^)]*)/i,
// swappable if display is none or starts with table except
// "table", "table-cell", or "table-caption"
View
@@ -156,3 +156,10 @@ section { background:#f0f; display:block; }
#span-14824 { display: block; }
#display { display: list-item !important; }
+
+/* fix get alpha opacity in IE8 */
+.fix-get-alpha-opacity-in-ie8 {
+ opacity: 0.5;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+}
+
View
@@ -1151,4 +1151,17 @@ test( "Do not throw on frame elements from css method (#15098)", 1, function() {
ok( false, "It did throw" );
}
});
+
+test( "get upper case alpha opacity in IE8", 1, function() {
+ var div = document.createElement( "div" ),
+ fixture = document.getElementById( "qunit-fixture" );
+
+ div.className = "fix-get-alpha-opacity-in-ie8";
+ fixture.appendChild( div );
+
+ equal( jQuery( div ).css( "opacity" ), "0.5", "get upper case alpha opacity in IE8 ok" );
+
+ fixture.removeChild( div );
+});
+
}

1 comment on commit c5e8e12

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Nov 8, 2014

Member

Re-landed from 3fed4b3

Member

mgol commented on c5e8e12 Nov 8, 2014

Re-landed from 3fed4b3

Please sign in to comment.