react 15.3.2 → 15.4.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/react-with-addons.js +3864 -21390
  2. package/dist/react-with-addons.min.js +3 -6
  3. package/dist/react.js +2639 -19486
  4. package/dist/react.min.js +2 -6
  5. package/lib/KeyEscapeUtils.js +0 -1
  6. package/lib/LinkedStateMixin.js +1 -3
  7. package/lib/PooledClass.js +3 -1
  8. package/lib/React.js +0 -1
  9. package/lib/ReactAddonsDOMDependencies.js +35 -0
  10. package/lib/ReactAddonsDOMDependenciesUMDShim.js +31 -0
  11. package/lib/ReactCSSTransitionGroup.js +60 -43
  12. package/lib/ReactCSSTransitionGroupChild.js +2 -3
  13. package/lib/ReactChildren.js +0 -1
  14. package/lib/ReactClass.js +38 -54
  15. package/lib/ReactComponent.js +0 -1
  16. package/lib/ReactComponentTreeDevtool.js +0 -1
  17. package/lib/ReactComponentTreeHook.js +84 -101
  18. package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +4 -7
  19. package/lib/ReactComponentWithPureRenderMixin.js +0 -1
  20. package/lib/ReactCurrentOwner.js +1 -2
  21. package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +5 -4
  22. package/lib/ReactDOMFactories.js +0 -1
  23. package/lib/ReactElement.js +6 -14
  24. package/lib/ReactElementSymbol.js +19 -0
  25. package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +3 -9
  26. package/lib/ReactElementValidator.js +1 -3
  27. package/lib/ReactFragment.js +0 -1
  28. package/lib/ReactLink.js +0 -1
  29. package/lib/ReactNoopUpdateQueue.js +0 -1
  30. package/lib/ReactPropTypeLocationNames.js +1 -1
  31. package/lib/ReactPropTypeLocations.js +2 -12
  32. package/lib/ReactPropTypes.js +5 -3
  33. package/lib/ReactPropTypesSecret.js +1 -1
  34. package/lib/ReactPureComponent.js +0 -1
  35. package/lib/ReactStateSetters.js +0 -1
  36. package/lib/ReactTransitionChildMapping.js +0 -1
  37. package/lib/ReactTransitionEvents.js +1 -2
  38. package/lib/ReactTransitionGroup.js +145 -142
  39. package/lib/ReactUMDEntry.js +11 -6
  40. package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +3 -6
  41. package/lib/ReactVersion.js +1 -2
  42. package/lib/ReactWithAddons.js +15 -3
  43. package/lib/ReactWithAddonsUMDEntry.js +11 -6
  44. package/lib/canDefineProperty.js +2 -1
  45. package/lib/checkReactTypeSpec.js +0 -1
  46. package/lib/deprecated.js +0 -1
  47. package/lib/flattenChildren.js +0 -1
  48. package/lib/getIteratorFn.js +0 -1
  49. package/lib/onlyChild.js +0 -1
  50. package/lib/reactProdInvariant.js +0 -1
  51. package/lib/shallowCompare.js +1 -2
  52. package/lib/sliceChildren.js +0 -1
  53. package/lib/traverseAllChildren.js +11 -3
  54. package/lib/update.js +6 -8
  55. package/package.json +1 -1
  56. package/lib/AutoFocusUtils.js +0 -24
  57. package/lib/BeforeInputEventPlugin.js +0 -390
  58. package/lib/CSSProperty.js +0 -148
  59. package/lib/CSSPropertyOperations.js +0 -205
  60. package/lib/CallbackQueue.js +0 -106
  61. package/lib/ChangeEventPlugin.js +0 -325
  62. package/lib/DOMChildrenOperations.js +0 -194
  63. package/lib/DOMLazyTree.js +0 -118
  64. package/lib/DOMProperty.js +0 -206
  65. package/lib/DOMPropertyOperations.js +0 -221
  66. package/lib/Danger.js +0 -48
  67. package/lib/DefaultEventPluginOrder.js +0 -27
  68. package/lib/DisabledInputUtils.js +0 -50
  69. package/lib/EnterLeaveEventPlugin.js +0 -105
  70. package/lib/EventConstants.js +0 -97
  71. package/lib/EventPluginHub.js +0 -251
  72. package/lib/EventPluginRegistry.js +0 -247
  73. package/lib/EventPluginUtils.js +0 -229
  74. package/lib/EventPropagators.js +0 -137
  75. package/lib/FallbackCompositionState.js +0 -95
  76. package/lib/HTMLDOMPropertyConfig.js +0 -212
  77. package/lib/LinkedValueUtils.js +0 -136
  78. package/lib/NativeMethodsMixin.js +0 -167
  79. package/lib/ReactBrowserEventEmitter.js +0 -330
  80. package/lib/ReactChildReconciler.js +0 -154
  81. package/lib/ReactChildrenMutationWarningHook.js +0 -54
  82. package/lib/ReactComponentBrowserEnvironment.js +0 -30
  83. package/lib/ReactComponentEnvironment.js +0 -45
  84. package/lib/ReactComponentTreeTestUtils.js +0 -87
  85. package/lib/ReactCompositeComponent.js +0 -904
  86. package/lib/ReactDOM.js +0 -110
  87. package/lib/ReactDOMButton.js +0 -24
  88. package/lib/ReactDOMComponent.js +0 -1006
  89. package/lib/ReactDOMComponentTree.js +0 -188
  90. package/lib/ReactDOMContainerInfo.js +0 -33
  91. package/lib/ReactDOMEmptyComponent.js +0 -60
  92. package/lib/ReactDOMFiber.js +0 -76
  93. package/lib/ReactDOMIDOperations.js +0 -34
  94. package/lib/ReactDOMInput.js +0 -269
  95. package/lib/ReactDOMNullInputValuePropHook.js +0 -43
  96. package/lib/ReactDOMOption.js +0 -123
  97. package/lib/ReactDOMSelect.js +0 -201
  98. package/lib/ReactDOMSelection.js +0 -212
  99. package/lib/ReactDOMServer.js +0 -26
  100. package/lib/ReactDOMTextComponent.js +0 -164
  101. package/lib/ReactDOMTextarea.js +0 -155
  102. package/lib/ReactDOMTreeTraversal.js +0 -136
  103. package/lib/ReactDOMUnknownPropertyHook.js +0 -112
  104. package/lib/ReactDebugTool.js +0 -301
  105. package/lib/ReactDefaultBatchingStrategy.js +0 -68
  106. package/lib/ReactDefaultInjection.js +0 -84
  107. package/lib/ReactEmptyComponent.js +0 -30
  108. package/lib/ReactErrorUtils.js +0 -76
  109. package/lib/ReactEventEmitterMixin.js +0 -33
  110. package/lib/ReactEventListener.js +0 -157
  111. package/lib/ReactFeatureFlags.js +0 -22
  112. package/lib/ReactHostComponent.js +0 -76
  113. package/lib/ReactHostOperationHistoryHook.js +0 -37
  114. package/lib/ReactInjection.js +0 -36
  115. package/lib/ReactInputSelection.js +0 -124
  116. package/lib/ReactInstanceHandles.js +0 -302
  117. package/lib/ReactInstanceMap.js +0 -48
  118. package/lib/ReactInstrumentation.js +0 -21
  119. package/lib/ReactInvalidSetStateWarningHook.js +0 -36
  120. package/lib/ReactMarkupChecksum.js +0 -50
  121. package/lib/ReactMount.js +0 -534
  122. package/lib/ReactMultiChild.js +0 -451
  123. package/lib/ReactMultiChildUpdateTypes.js +0 -32
  124. package/lib/ReactNative.js +0 -71
  125. package/lib/ReactNativeAttributePayload.js +0 -371
  126. package/lib/ReactNativeBaseComponent.js +0 -198
  127. package/lib/ReactNativeBridgeEventPlugin.js +0 -60
  128. package/lib/ReactNativeComponentEnvironment.js +0 -31
  129. package/lib/ReactNativeComponentTree.js +0 -68
  130. package/lib/ReactNativeContainerInfo.js +0 -21
  131. package/lib/ReactNativeDOMIDOperations.js +0 -79
  132. package/lib/ReactNativeDefaultInjection.js +0 -101
  133. package/lib/ReactNativeEventEmitter.js +0 -191
  134. package/lib/ReactNativeEventPluginOrder.js +0 -16
  135. package/lib/ReactNativeGlobalResponderHandler.js +0 -25
  136. package/lib/ReactNativeMount.js +0 -193
  137. package/lib/ReactNativePropRegistry.js +0 -52
  138. package/lib/ReactNativeReconcileTransaction.js +0 -129
  139. package/lib/ReactNativeTagHandles.js +0 -56
  140. package/lib/ReactNativeTextComponent.js +0 -71
  141. package/lib/ReactNativeTreeTraversal.js +0 -127
  142. package/lib/ReactNodeTypes.js +0 -40
  143. package/lib/ReactNoop.js +0 -173
  144. package/lib/ReactOwner.js +0 -94
  145. package/lib/ReactPerf.js +0 -494
  146. package/lib/ReactReconcileTransaction.js +0 -178
  147. package/lib/ReactReconciler.js +0 -168
  148. package/lib/ReactRef.js +0 -80
  149. package/lib/ReactServerBatchingStrategy.js +0 -22
  150. package/lib/ReactServerRendering.js +0 -90
  151. package/lib/ReactServerRenderingTransaction.js +0 -90
  152. package/lib/ReactServerUpdateQueue.js +0 -141
  153. package/lib/ReactSimpleEmptyComponent.js +0 -37
  154. package/lib/ReactTestMount.js +0 -126
  155. package/lib/ReactTestReconcileTransaction.js +0 -121
  156. package/lib/ReactTestRenderer.js +0 -144
  157. package/lib/ReactTestUtils.js +0 -518
  158. package/lib/ReactUpdateQueue.js +0 -226
  159. package/lib/ReactUpdates.js +0 -251
  160. package/lib/ResponderEventPlugin.js +0 -510
  161. package/lib/ResponderSyntheticEvent.js +0 -39
  162. package/lib/ResponderTouchHistoryStore.js +0 -184
  163. package/lib/SVGDOMPropertyConfig.js +0 -302
  164. package/lib/SelectEventPlugin.js +0 -196
  165. package/lib/SimpleEventPlugin.js +0 -635
  166. package/lib/SyntheticAnimationEvent.js +0 -39
  167. package/lib/SyntheticClipboardEvent.js +0 -38
  168. package/lib/SyntheticCompositionEvent.js +0 -36
  169. package/lib/SyntheticDragEvent.js +0 -36
  170. package/lib/SyntheticEvent.js +0 -268
  171. package/lib/SyntheticFocusEvent.js +0 -36
  172. package/lib/SyntheticInputEvent.js +0 -37
  173. package/lib/SyntheticKeyboardEvent.js +0 -84
  174. package/lib/SyntheticMouseEvent.js +0 -72
  175. package/lib/SyntheticTouchEvent.js +0 -45
  176. package/lib/SyntheticTransitionEvent.js +0 -39
  177. package/lib/SyntheticUIEvent.js +0 -59
  178. package/lib/SyntheticWheelEvent.js +0 -54
  179. package/lib/TapEventPlugin.js +0 -110
  180. package/lib/TouchHistoryMath.js +0 -99
  181. package/lib/Transaction.js +0 -233
  182. package/lib/ViewportMetrics.js +0 -27
  183. package/lib/accumulate.js +0 -46
  184. package/lib/accumulateInto.js +0 -58
  185. package/lib/adler32.js +0 -44
  186. package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
  187. package/lib/createReactNativeComponentClass.js +0 -42
  188. package/lib/dangerousStyleValue.js +0 -79
  189. package/lib/escapeTextContentForBrowser.js +0 -123
  190. package/lib/findDOMNode.js +0 -60
  191. package/lib/findNodeHandle.js +0 -91
  192. package/lib/forEachAccumulated.js +0 -31
  193. package/lib/getEventCharCode.js +0 -50
  194. package/lib/getEventKey.js +0 -102
  195. package/lib/getEventModifierState.js +0 -43
  196. package/lib/getEventTarget.js +0 -35
  197. package/lib/getHostComponentFromComposite.js +0 -30
  198. package/lib/getNodeForCharacterOffset.js +0 -74
  199. package/lib/getTestDocument.js +0 -21
  200. package/lib/getTextContentAccessor.js +0 -33
  201. package/lib/getVendorPrefixedEventName.js +0 -101
  202. package/lib/instantiateReactComponent.js +0 -119
  203. package/lib/isEventSupported.js +0 -60
  204. package/lib/isTextInputElement.js +0 -51
  205. package/lib/quoteAttributeValueForBrowser.js +0 -26
  206. package/lib/reactComponentExpect.js +0 -217
  207. package/lib/setInnerHTML.js +0 -98
  208. package/lib/setTextContent.js +0 -48
  209. package/lib/shouldUpdateReactComponent.js +0 -42
  210. package/lib/validateDOMNesting.js +0 -382
@@ -1,148 +0,0 @@
1
- /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule CSSProperty
10
- */
11
-
12
- 'use strict';
13
-
14
- /**
15
- * CSS properties which accept numbers but are not in units of "px".
16
- */
17
-
18
- var isUnitlessNumber = {
19
- animationIterationCount: true,
20
- borderImageOutset: true,
21
- borderImageSlice: true,
22
- borderImageWidth: true,
23
- boxFlex: true,
24
- boxFlexGroup: true,
25
- boxOrdinalGroup: true,
26
- columnCount: true,
27
- flex: true,
28
- flexGrow: true,
29
- flexPositive: true,
30
- flexShrink: true,
31
- flexNegative: true,
32
- flexOrder: true,
33
- gridRow: true,
34
- gridColumn: true,
35
- fontWeight: true,
36
- lineClamp: true,
37
- lineHeight: true,
38
- opacity: true,
39
- order: true,
40
- orphans: true,
41
- tabSize: true,
42
- widows: true,
43
- zIndex: true,
44
- zoom: true,
45
-
46
- // SVG-related properties
47
- fillOpacity: true,
48
- floodOpacity: true,
49
- stopOpacity: true,
50
- strokeDasharray: true,
51
- strokeDashoffset: true,
52
- strokeMiterlimit: true,
53
- strokeOpacity: true,
54
- strokeWidth: true
55
- };
56
-
57
- /**
58
- * @param {string} prefix vendor-specific prefix, eg: Webkit
59
- * @param {string} key style name, eg: transitionDuration
60
- * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
61
- * WebkitTransitionDuration
62
- */
63
- function prefixKey(prefix, key) {
64
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
65
- }
66
-
67
- /**
68
- * Support style names that may come passed in prefixed by adding permutations
69
- * of vendor prefixes.
70
- */
71
- var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
72
-
73
- // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
74
- // infinite loop, because it iterates over the newly added props too.
75
- Object.keys(isUnitlessNumber).forEach(function (prop) {
76
- prefixes.forEach(function (prefix) {
77
- isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
78
- });
79
- });
80
-
81
- /**
82
- * Most style properties can be unset by doing .style[prop] = '' but IE8
83
- * doesn't like doing that with shorthand properties so for the properties that
84
- * IE8 breaks on, which are listed here, we instead unset each of the
85
- * individual properties. See http://bugs.jquery.com/ticket/12385.
86
- * The 4-value 'clock' properties like margin, padding, border-width seem to
87
- * behave without any problems. Curiously, list-style works too without any
88
- * special prodding.
89
- */
90
- var shorthandPropertyExpansions = {
91
- background: {
92
- backgroundAttachment: true,
93
- backgroundColor: true,
94
- backgroundImage: true,
95
- backgroundPositionX: true,
96
- backgroundPositionY: true,
97
- backgroundRepeat: true
98
- },
99
- backgroundPosition: {
100
- backgroundPositionX: true,
101
- backgroundPositionY: true
102
- },
103
- border: {
104
- borderWidth: true,
105
- borderStyle: true,
106
- borderColor: true
107
- },
108
- borderBottom: {
109
- borderBottomWidth: true,
110
- borderBottomStyle: true,
111
- borderBottomColor: true
112
- },
113
- borderLeft: {
114
- borderLeftWidth: true,
115
- borderLeftStyle: true,
116
- borderLeftColor: true
117
- },
118
- borderRight: {
119
- borderRightWidth: true,
120
- borderRightStyle: true,
121
- borderRightColor: true
122
- },
123
- borderTop: {
124
- borderTopWidth: true,
125
- borderTopStyle: true,
126
- borderTopColor: true
127
- },
128
- font: {
129
- fontStyle: true,
130
- fontVariant: true,
131
- fontWeight: true,
132
- fontSize: true,
133
- lineHeight: true,
134
- fontFamily: true
135
- },
136
- outline: {
137
- outlineWidth: true,
138
- outlineStyle: true,
139
- outlineColor: true
140
- }
141
- };
142
-
143
- var CSSProperty = {
144
- isUnitlessNumber: isUnitlessNumber,
145
- shorthandPropertyExpansions: shorthandPropertyExpansions
146
- };
147
-
148
- module.exports = CSSProperty;
@@ -1,205 +0,0 @@
1
- /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule CSSPropertyOperations
10
- */
11
-
12
- 'use strict';
13
-
14
- var CSSProperty = require('./CSSProperty');
15
- var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
16
- var ReactInstrumentation = require('./ReactInstrumentation');
17
-
18
- var camelizeStyleName = require('fbjs/lib/camelizeStyleName');
19
- var dangerousStyleValue = require('./dangerousStyleValue');
20
- var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
21
- var memoizeStringOnly = require('fbjs/lib/memoizeStringOnly');
22
- var warning = require('fbjs/lib/warning');
23
-
24
- var processStyleName = memoizeStringOnly(function (styleName) {
25
- return hyphenateStyleName(styleName);
26
- });
27
-
28
- var hasShorthandPropertyBug = false;
29
- var styleFloatAccessor = 'cssFloat';
30
- if (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
- }
38
- // IE8 only supports accessing cssFloat (standard) as styleFloat
39
- if (document.documentElement.style.cssFloat === undefined) {
40
- styleFloatAccessor = 'styleFloat';
41
- }
42
- }
43
-
44
- if (process.env.NODE_ENV !== 'production') {
45
- // 'msTransform' is correct, but the other prefixes should be capitalized
46
- var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
47
-
48
- // style values shouldn't contain a semicolon
49
- var badStyleValueWithSemicolonPattern = /;\s*$/;
50
-
51
- var warnedStyleNames = {};
52
- var warnedStyleValues = {};
53
- var warnedForNaNValue = false;
54
-
55
- var warnHyphenatedStyleName = function (name, owner) {
56
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
57
- return;
58
- }
59
-
60
- warnedStyleNames[name] = true;
61
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
62
- };
63
-
64
- var warnBadVendoredStyleName = function (name, owner) {
65
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
66
- return;
67
- }
68
-
69
- warnedStyleNames[name] = true;
70
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
71
- };
72
-
73
- var warnStyleValueWithSemicolon = function (name, value, owner) {
74
- if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
75
- return;
76
- }
77
-
78
- warnedStyleValues[value] = true;
79
- process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
80
- };
81
-
82
- var warnStyleValueIsNaN = function (name, value, owner) {
83
- if (warnedForNaNValue) {
84
- return;
85
- }
86
-
87
- warnedForNaNValue = true;
88
- process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
89
- };
90
-
91
- var checkRenderMessage = function (owner) {
92
- if (owner) {
93
- var name = owner.getName();
94
- if (name) {
95
- return ' Check the render method of `' + name + '`.';
96
- }
97
- }
98
- return '';
99
- };
100
-
101
- /**
102
- * @param {string} name
103
- * @param {*} value
104
- * @param {ReactDOMComponent} component
105
- */
106
- var warnValidStyle = function (name, value, component) {
107
- var owner;
108
- if (component) {
109
- owner = component._currentElement._owner;
110
- }
111
- if (name.indexOf('-') > -1) {
112
- warnHyphenatedStyleName(name, owner);
113
- } else if (badVendoredStyleNamePattern.test(name)) {
114
- warnBadVendoredStyleName(name, owner);
115
- } else if (badStyleValueWithSemicolonPattern.test(value)) {
116
- warnStyleValueWithSemicolon(name, value, owner);
117
- }
118
-
119
- if (typeof value === 'number' && isNaN(value)) {
120
- warnStyleValueIsNaN(name, value, owner);
121
- }
122
- };
123
- }
124
-
125
- /**
126
- * Operations for dealing with CSS properties.
127
- */
128
- var CSSPropertyOperations = {
129
-
130
- /**
131
- * Serializes a mapping of style properties for use as inline styles:
132
- *
133
- * > createMarkupForStyles({width: '200px', height: 0})
134
- * "width:200px;height:0;"
135
- *
136
- * Undefined values are ignored so that declarative programming is easier.
137
- * The result should be HTML-escaped before insertion into the DOM.
138
- *
139
- * @param {object} styles
140
- * @param {ReactDOMComponent} component
141
- * @return {?string}
142
- */
143
- createMarkupForStyles: function (styles, component) {
144
- var serialized = '';
145
- for (var styleName in styles) {
146
- if (!styles.hasOwnProperty(styleName)) {
147
- continue;
148
- }
149
- var styleValue = styles[styleName];
150
- if (process.env.NODE_ENV !== 'production') {
151
- warnValidStyle(styleName, styleValue, component);
152
- }
153
- if (styleValue != null) {
154
- serialized += processStyleName(styleName) + ':';
155
- serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
156
- }
157
- }
158
- return serialized || null;
159
- },
160
-
161
- /**
162
- * Sets the value for multiple styles on a node. If a value is specified as
163
- * '' (empty string), the corresponding style property will be unset.
164
- *
165
- * @param {DOMElement} node
166
- * @param {object} styles
167
- * @param {ReactDOMComponent} component
168
- */
169
- setValueForStyles: function (node, styles, component) {
170
- if (process.env.NODE_ENV !== 'production') {
171
- ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles);
172
- }
173
-
174
- var style = node.style;
175
- for (var styleName in styles) {
176
- if (!styles.hasOwnProperty(styleName)) {
177
- continue;
178
- }
179
- if (process.env.NODE_ENV !== 'production') {
180
- warnValidStyle(styleName, styles[styleName], component);
181
- }
182
- var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
183
- if (styleName === 'float' || styleName === 'cssFloat') {
184
- styleName = styleFloatAccessor;
185
- }
186
- if (styleValue) {
187
- style[styleName] = styleValue;
188
- } else {
189
- var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
190
- if (expansion) {
191
- // Shorthand property that IE8 won't like unsetting, so unset each
192
- // component to placate it
193
- for (var individualStyleName in expansion) {
194
- style[individualStyleName] = '';
195
- }
196
- } else {
197
- style[styleName] = '';
198
- }
199
- }
200
- }
201
- }
202
-
203
- };
204
-
205
- module.exports = CSSPropertyOperations;
@@ -1,106 +0,0 @@
1
- /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule CallbackQueue
10
- */
11
-
12
- 'use strict';
13
-
14
- var _prodInvariant = require('./reactProdInvariant'),
15
- _assign = require('object-assign');
16
-
17
- var PooledClass = require('./PooledClass');
18
-
19
- var invariant = require('fbjs/lib/invariant');
20
-
21
- /**
22
- * A specialized pseudo-event module to help keep track of components waiting to
23
- * be notified when their DOM representations are available for use.
24
- *
25
- * This implements `PooledClass`, so you should never need to instantiate this.
26
- * Instead, use `CallbackQueue.getPooled()`.
27
- *
28
- * @class ReactMountReady
29
- * @implements PooledClass
30
- * @internal
31
- */
32
- function CallbackQueue() {
33
- this._callbacks = null;
34
- this._contexts = null;
35
- }
36
-
37
- _assign(CallbackQueue.prototype, {
38
-
39
- /**
40
- * Enqueues a callback to be invoked when `notifyAll` is invoked.
41
- *
42
- * @param {function} callback Invoked when `notifyAll` is invoked.
43
- * @param {?object} context Context to call `callback` with.
44
- * @internal
45
- */
46
- enqueue: function (callback, context) {
47
- this._callbacks = this._callbacks || [];
48
- this._contexts = this._contexts || [];
49
- this._callbacks.push(callback);
50
- this._contexts.push(context);
51
- },
52
-
53
- /**
54
- * Invokes all enqueued callbacks and clears the queue. This is invoked after
55
- * the DOM representation of a component has been created or updated.
56
- *
57
- * @internal
58
- */
59
- notifyAll: function () {
60
- var callbacks = this._callbacks;
61
- var contexts = this._contexts;
62
- if (callbacks) {
63
- !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
64
- this._callbacks = null;
65
- this._contexts = null;
66
- for (var i = 0; i < callbacks.length; i++) {
67
- callbacks[i].call(contexts[i]);
68
- }
69
- callbacks.length = 0;
70
- contexts.length = 0;
71
- }
72
- },
73
-
74
- checkpoint: function () {
75
- return this._callbacks ? this._callbacks.length : 0;
76
- },
77
-
78
- rollback: function (len) {
79
- if (this._callbacks) {
80
- this._callbacks.length = len;
81
- this._contexts.length = len;
82
- }
83
- },
84
-
85
- /**
86
- * Resets the internal queue.
87
- *
88
- * @internal
89
- */
90
- reset: function () {
91
- this._callbacks = null;
92
- this._contexts = null;
93
- },
94
-
95
- /**
96
- * `PooledClass` looks for this.
97
- */
98
- destructor: function () {
99
- this.reset();
100
- }
101
-
102
- });
103
-
104
- PooledClass.addPoolingTo(CallbackQueue);
105
-
106
- module.exports = CallbackQueue;