diff --git a/src/renderers/dom/shared/CSSProperty.js b/src/renderers/dom/shared/CSSProperty.js index fa0645c9870..f7e1de4e9f0 100644 --- a/src/renderers/dom/shared/CSSProperty.js +++ b/src/renderers/dom/shared/CSSProperty.js @@ -77,71 +77,8 @@ Object.keys(isUnitlessNumber).forEach(function(prop) { }); }); -/** - * Most style properties can be unset by doing .style[prop] = '' but IE8 - * doesn't like doing that with shorthand properties so for the properties that - * IE8 breaks on, which are listed here, we instead unset each of the - * individual properties. See http://bugs.jquery.com/ticket/12385. - * The 4-value 'clock' properties like margin, padding, border-width seem to - * behave without any problems. Curiously, list-style works too without any - * special prodding. - */ -var shorthandPropertyExpansions = { - background: { - backgroundAttachment: true, - backgroundColor: true, - backgroundImage: true, - backgroundPositionX: true, - backgroundPositionY: true, - backgroundRepeat: true, - }, - backgroundPosition: { - backgroundPositionX: true, - backgroundPositionY: true, - }, - border: { - borderWidth: true, - borderStyle: true, - borderColor: true, - }, - borderBottom: { - borderBottomWidth: true, - borderBottomStyle: true, - borderBottomColor: true, - }, - borderLeft: { - borderLeftWidth: true, - borderLeftStyle: true, - borderLeftColor: true, - }, - borderRight: { - borderRightWidth: true, - borderRightStyle: true, - borderRightColor: true, - }, - borderTop: { - borderTopWidth: true, - borderTopStyle: true, - borderTopColor: true, - }, - font: { - fontStyle: true, - fontVariant: true, - fontWeight: true, - fontSize: true, - lineHeight: true, - fontFamily: true, - }, - outline: { - outlineWidth: true, - outlineStyle: true, - outlineColor: true, - }, -}; - var CSSProperty = { isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions, }; module.exports = CSSProperty; diff --git a/src/renderers/dom/shared/CSSPropertyOperations.js b/src/renderers/dom/shared/CSSPropertyOperations.js index d23c5b6be41..dcbd9250fc8 100644 --- a/src/renderers/dom/shared/CSSPropertyOperations.js +++ b/src/renderers/dom/shared/CSSPropertyOperations.js @@ -11,9 +11,6 @@ 'use strict'; -var CSSProperty = require('CSSProperty'); -var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment'); - var camelizeStyleName = require('fbjs/lib/camelizeStyleName'); var dangerousStyleValue = require('dangerousStyleValue'); var getComponentName = require('getComponentName'); @@ -29,22 +26,6 @@ var processStyleName = memoizeStringOnly(function(styleName) { return hyphenateStyleName(styleName); }); -var hasShorthandPropertyBug = false; -var styleFloatAccessor = 'cssFloat'; -if (ExecutionEnvironment.canUseDOM) { - var tempStyle = document.createElement('div').style; - try { - // IE8 throws "Invalid argument." if resetting shorthand style properties. - tempStyle.font = ''; - } catch (e) { - hasShorthandPropertyBug = true; - } - // IE8 only supports accessing cssFloat (standard) as styleFloat - if (document.documentElement.style.cssFloat === undefined) { - styleFloatAccessor = 'styleFloat'; - } -} - if (__DEV__) { // 'msTransform' is correct, but the other prefixes should be capitalized var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; @@ -215,24 +196,10 @@ var CSSPropertyOperations = { styles[styleName], component, ); - if (styleName === 'float' || styleName === 'cssFloat') { - styleName = styleFloatAccessor; - } - if (styleValue) { - style[styleName] = styleValue; - } else { - var expansion = hasShorthandPropertyBug && - CSSProperty.shorthandPropertyExpansions[styleName]; - if (expansion) { - // Shorthand property that IE8 won't like unsetting, so unset each - // component to placate it - for (var individualStyleName in expansion) { - style[individualStyleName] = ''; - } - } else { - style[styleName] = ''; - } + if (styleName === 'float') { + styleName = 'cssFloat'; } + style[styleName] = styleValue || ''; } }, };