File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,16 @@ var processStyleName = memoizeStringOnly(function(styleName) {
2525 return hyphenateStyleName ( styleName ) ;
2626} ) ;
2727
28+ var hasShorthandPropertyBug = false ;
2829var styleFloatAccessor = 'cssFloat' ;
2930if ( ExecutionEnvironment . canUseDOM ) {
31+ var tempStyle = document . createElement ( 'div' ) . style ;
32+ try {
33+ // IE8 throws "Invalid argument." if resetting shorthand style properties.
34+ tempStyle . font = '' ;
35+ } catch ( e ) {
36+ hasShorthandPropertyBug = true ;
37+ }
3038 // IE8 only supports accessing cssFloat (standard) as styleFloat
3139 if ( document . documentElement . style . cssFloat === undefined ) {
3240 styleFloatAccessor = 'styleFloat' ;
@@ -159,7 +167,9 @@ var CSSPropertyOperations = {
159167 if ( styleValue ) {
160168 style [ styleName ] = styleValue ;
161169 } else {
162- var expansion = CSSProperty . shorthandPropertyExpansions [ styleName ] ;
170+ var expansion =
171+ hasShorthandPropertyBug &&
172+ CSSProperty . shorthandPropertyExpansions [ styleName ] ;
163173 if ( expansion ) {
164174 // Shorthand property that IE8 won't like unsetting, so unset each
165175 // component to placate it
You can’t perform that action at this time.
0 commit comments