cssFloat is only accessible as styleFloat on IE8
Andreas Svensson committed
Jul 16, 2014 at 23:44 UTC
ffafae5cfe1e1915be9c5498c560fc1c0862906f
1 file changed
+12
src/browser/ui/dom/CSSPropertyOperations.js
+12
@@ -20,6 +20,7 @@
20
"use strict";
21
22
var CSSProperty = require('CSSProperty');
23
+var ExecutionEnvironment = require('ExecutionEnvironment');
24
25
var dangerousStyleValue = require('dangerousStyleValue');
26
var hyphenateStyleName = require('hyphenateStyleName');
@@ -29,6 +30,14 @@ var processStyleName = memoizeStringOnly(function(styleName) {
30
return hyphenateStyleName(styleName);
31
});
32
33
+var styleFloatAccessor = 'cssFloat';
34
+if (ExecutionEnvironment.canUseDOM) {
35
+ // IE8 only supports accessing cssFloat (standard) as styleFloat
36
+ if (document.documentElement.style.cssFloat === undefined) {
37
+ styleFloatAccessor = 'styleFloat';
38
+ }
39
+}
40
+
41
/**
42
* Operations for dealing with CSS properties.
43
*/
@@ -75,6 +84,9 @@ var CSSPropertyOperations = {
84
continue;
85
}
86
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
87
+ if (styleName === 'float') {
88
+ styleName = styleFloatAccessor;
89
+ }
90
if (styleValue) {
91
style[styleName] = styleValue;
92
} else {