mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #1854 from syranide/floatfix
cssFloat is only accessible as styleFloat on IE8
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
"use strict";
|
||||
|
||||
var CSSProperty = require('CSSProperty');
|
||||
var ExecutionEnvironment = require('ExecutionEnvironment');
|
||||
|
||||
var dangerousStyleValue = require('dangerousStyleValue');
|
||||
var hyphenateStyleName = require('hyphenateStyleName');
|
||||
@@ -29,6 +30,14 @@ var processStyleName = memoizeStringOnly(function(styleName) {
|
||||
return hyphenateStyleName(styleName);
|
||||
});
|
||||
|
||||
var styleFloatAccessor = 'cssFloat';
|
||||
if (ExecutionEnvironment.canUseDOM) {
|
||||
// IE8 only supports accessing cssFloat (standard) as styleFloat
|
||||
if (document.documentElement.style.cssFloat === undefined) {
|
||||
styleFloatAccessor = 'styleFloat';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operations for dealing with CSS properties.
|
||||
*/
|
||||
@@ -75,6 +84,9 @@ var CSSPropertyOperations = {
|
||||
continue;
|
||||
}
|
||||
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
|
||||
if (styleName === 'float') {
|
||||
styleName = styleFloatAccessor;
|
||||
}
|
||||
if (styleValue) {
|
||||
style[styleName] = styleValue;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user