Skip to content

Commit c5e8e12

Browse files
mescodamgol
authored andcommitted
CSS: Fix get upper case alpha opacity in IE8
Fixes gh-1705 Closes gh-1704
1 parent 3f9fda8 commit c5e8e12

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var
2222
// BuildExclude
2323
getStyles = curCSS.getStyles,
2424
ralpha = /alpha\([^)]*\)/i,
25-
ropacity = /opacity\s*=\s*([^)]*)/,
25+
ropacity = /opacity\s*=\s*([^)]*)/i,
2626

2727
// swappable if display is none or starts with table except
2828
// "table", "table-cell", or "table-caption"

test/data/testsuite.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,10 @@ section { background:#f0f; display:block; }
156156
#span-14824 { display: block; }
157157

158158
#display { display: list-item !important; }
159+
160+
/* fix get alpha opacity in IE8 */
161+
.fix-get-alpha-opacity-in-ie8 {
162+
opacity: 0.5;
163+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
164+
}
165+

test/unit/css.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,4 +1151,17 @@ test( "Do not throw on frame elements from css method (#15098)", 1, function() {
11511151
ok( false, "It did throw" );
11521152
}
11531153
});
1154+
1155+
test( "get upper case alpha opacity in IE8", 1, function() {
1156+
var div = document.createElement( "div" ),
1157+
fixture = document.getElementById( "qunit-fixture" );
1158+
1159+
div.className = "fix-get-alpha-opacity-in-ie8";
1160+
fixture.appendChild( div );
1161+
1162+
equal( jQuery( div ).css( "opacity" ), "0.5", "get upper case alpha opacity in IE8 ok" );
1163+
1164+
fixture.removeChild( div );
1165+
});
1166+
11541167
}

0 commit comments

Comments
 (0)