/**1* Copyright 2013-2015, Facebook, Inc.2* All rights reserved.3*4* This source code is licensed under the BSD-style license found in the5* LICENSE file in the root directory of this source tree. An additional grant6* of patent rights can be found in the PATENTS file in the same directory.7*8* @providesModule CSSProperty9*/1011'use strict';1213/**14* CSS properties which accept numbers but are not in units of "px".15*/16var isUnitlessNumber = {17boxFlex: true,18boxFlexGroup: true,19columnCount: true,20flex: true,21flexGrow: true,22flexPositive: true,23flexShrink: true,24flexNegative: true,25fontWeight: true,26lineClamp: true,27lineHeight: true,28opacity: true,29order: true,30orphans: true,31widows: true,32zIndex: true,33zoom: true,3435// SVG-related properties36fillOpacity: true,37strokeDashoffset: true,38strokeOpacity: true,39strokeWidth: true40};4142/**43* @param {string} prefix vendor-specific prefix, eg: Webkit44* @param {string} key style name, eg: transitionDuration45* @return {string} style name prefixed with `prefix`, properly camelCased, eg:46* WebkitTransitionDuration47*/48function prefixKey(prefix, key) {49return prefix + key.charAt(0).toUpperCase() + key.substring(1);50}5152/**53* Support style names that may come passed in prefixed by adding permutations54* of vendor prefixes.55*/56var prefixes = ['Webkit', 'ms', 'Moz', 'O'];5758// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an59// infinite loop, because it iterates over the newly added props too.60Object.keys(isUnitlessNumber).forEach(function(prop) {61prefixes.forEach(function(prefix) {62isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];63});64});6566/**67* Most style properties can be unset by doing .style[prop] = '' but IE868* doesn't like doing that with shorthand properties so for the properties that69* IE8 breaks on, which are listed here, we instead unset each of the70* individual properties. See http://bugs.jquery.com/ticket/12385.71* The 4-value 'clock' properties like margin, padding, border-width seem to72* behave without any problems. Curiously, list-style works too without any73* special prodding.74*/75var shorthandPropertyExpansions = {76background: {77backgroundImage: true,78backgroundPosition: true,79backgroundRepeat: true,80backgroundColor: true81},82border: {83borderWidth: true,84borderStyle: true,85borderColor: true86},87borderBottom: {88borderBottomWidth: true,89borderBottomStyle: true,90borderBottomColor: true91},92borderLeft: {93borderLeftWidth: true,94borderLeftStyle: true,95borderLeftColor: true96},97borderRight: {98borderRightWidth: true,99borderRightStyle: true,100borderRightColor: true101},102borderTop: {103borderTopWidth: true,104borderTopStyle: true,105borderTopColor: true106},107font: {108fontStyle: true,109fontVariant: true,110fontWeight: true,111fontSize: true,112lineHeight: true,113fontFamily: true114}115};116117var CSSProperty = {118isUnitlessNumber: isUnitlessNumber,119shorthandPropertyExpansions: shorthandPropertyExpansions120};121122module.exports = CSSProperty;123124125