react-dom 15.6.0 → 15.6.1

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ReactDOMServer v15.6.0
2
+ * ReactDOMServer v15.6.1
3
3
  */
4
4
 
5
5
  ;(function(f) {
@@ -771,10 +771,6 @@ if ("development" !== 'production') {
771
771
  * @param {ReactDOMComponent} component
772
772
  */
773
773
  var warnValidStyle = function (name, value, component) {
774
- // Don't warn for CSS variables
775
- if (name.indexOf('--') === 0) {
776
- return;
777
- }
778
774
  var owner;
779
775
  if (component) {
780
776
  owner = component._currentElement._owner;
@@ -816,13 +812,16 @@ var CSSPropertyOperations = {
816
812
  if (!styles.hasOwnProperty(styleName)) {
817
813
  continue;
818
814
  }
815
+ var isCustomProperty = styleName.indexOf('--') === 0;
819
816
  var styleValue = styles[styleName];
820
817
  if ("development" !== 'production') {
821
- warnValidStyle(styleName, styleValue, component);
818
+ if (!isCustomProperty) {
819
+ warnValidStyle(styleName, styleValue, component);
820
+ }
822
821
  }
823
822
  if (styleValue != null) {
824
823
  serialized += processStyleName(styleName) + ':';
825
- serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
824
+ serialized += dangerousStyleValue(styleName, styleValue, component, isCustomProperty) + ';';
826
825
  }
827
826
  }
828
827
  return serialized || null;
@@ -850,14 +849,17 @@ var CSSPropertyOperations = {
850
849
  if (!styles.hasOwnProperty(styleName)) {
851
850
  continue;
852
851
  }
852
+ var isCustomProperty = styleName.indexOf('--') === 0;
853
853
  if ("development" !== 'production') {
854
- warnValidStyle(styleName, styles[styleName], component);
854
+ if (!isCustomProperty) {
855
+ warnValidStyle(styleName, styles[styleName], component);
856
+ }
855
857
  }
856
- var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
858
+ var styleValue = dangerousStyleValue(styleName, styles[styleName], component, isCustomProperty);
857
859
  if (styleName === 'float' || styleName === 'cssFloat') {
858
860
  styleName = styleFloatAccessor;
859
861
  }
860
- if (styleName.indexOf('--') === 0) {
862
+ if (isCustomProperty) {
861
863
  style.setProperty(styleName, styleValue);
862
864
  } else if (styleValue) {
863
865
  style[styleName] = styleValue;
@@ -11094,7 +11096,7 @@ module.exports = ReactUpdates;
11094
11096
 
11095
11097
  'use strict';
11096
11098
 
11097
- module.exports = '15.6.0';
11099
+ module.exports = '15.6.1';
11098
11100
  },{}],77:[function(_dereq_,module,exports){
11099
11101
  /**
11100
11102
  * Copyright 2013-present, Facebook, Inc.
@@ -13154,7 +13156,7 @@ var styleWarnings = {};
13154
13156
  * @param {ReactDOMComponent} component
13155
13157
  * @return {string} Normalized style value with dimensions applied.
13156
13158
  */
13157
- function dangerousStyleValue(name, value, component) {
13159
+ function dangerousStyleValue(name, value, component, isCustomProperty) {
13158
13160
  // Note that we've removed escapeTextForBrowser() calls here since the
13159
13161
  // whole string will be escaped when the attribute is injected into
13160
13162
  // the markup. If you provide unsafe user data here they can inject
@@ -13171,7 +13173,7 @@ function dangerousStyleValue(name, value, component) {
13171
13173
  }
13172
13174
 
13173
13175
  var isNonNumeric = isNaN(value);
13174
- if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
13176
+ if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
13175
13177
  return '' + value; // cast to string
13176
13178
  }
13177
13179
 
@@ -13983,10 +13985,11 @@ var inputValueTracking = {
13983
13985
 
13984
13986
  var currentValue = '' + node[valueField];
13985
13987
 
13986
- // if someone has already defined a value bail and don't track value
13987
- // will cause over reporting of changes, but it's better then a hard failure
13988
- // (needed for certain tests that spyOn input values)
13989
- if (node.hasOwnProperty(valueField)) {
13988
+ // if someone has already defined a value or Safari, then bail
13989
+ // and don't track value will cause over reporting of changes,
13990
+ // but it's better then a hard failure
13991
+ // (needed for certain tests that spyOn input values and Safari)
13992
+ if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
13990
13993
  return;
13991
13994
  }
13992
13995
 
@@ -16591,6 +16594,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
16591
16594
  function createChainableTypeChecker(validate) {
16592
16595
  if ("development" !== 'production') {
16593
16596
  var manualPropTypeCallCache = {};
16597
+ var manualPropTypeWarningCount = 0;
16594
16598
  }
16595
16599
  function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
16596
16600
  componentName = componentName || ANONYMOUS;
@@ -16608,7 +16612,11 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
16608
16612
  } else if ("development" !== 'production' && typeof console !== 'undefined') {
16609
16613
  // Old behavior for people using React.PropTypes
16610
16614
  var cacheKey = componentName + ':' + propName;
16611
- if (!manualPropTypeCallCache[cacheKey]) {
16615
+ if (
16616
+ !manualPropTypeCallCache[cacheKey] &&
16617
+ // Avoid spamming the console because they are often not actionable except for lib authors
16618
+ manualPropTypeWarningCount < 3
16619
+ ) {
16612
16620
  warning(
16613
16621
  false,
16614
16622
  'You are manually calling a React.PropTypes validation ' +
@@ -16620,6 +16628,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
16620
16628
  componentName
16621
16629
  );
16622
16630
  manualPropTypeCallCache[cacheKey] = true;
16631
+ manualPropTypeWarningCount++;
16623
16632
  }
16624
16633
  }
16625
16634
  }
@@ -16757,6 +16766,20 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
16757
16766
  return emptyFunction.thatReturnsNull;
16758
16767
  }
16759
16768
 
16769
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
16770
+ var checker = arrayOfTypeCheckers[i];
16771
+ if (typeof checker !== 'function') {
16772
+ warning(
16773
+ false,
16774
+ 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
16775
+ 'received %s at index %s.',
16776
+ getPostfixForTypeWarning(checker),
16777
+ i
16778
+ );
16779
+ return emptyFunction.thatReturnsNull;
16780
+ }
16781
+ }
16782
+
16760
16783
  function validate(props, propName, componentName, location, propFullName) {
16761
16784
  for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
16762
16785
  var checker = arrayOfTypeCheckers[i];
@@ -16889,6 +16912,9 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
16889
16912
  // This handles more types than `getPropType`. Only used for error messages.
16890
16913
  // See `createPrimitiveTypeChecker`.
16891
16914
  function getPreciseType(propValue) {
16915
+ if (typeof propValue === 'undefined' || propValue === null) {
16916
+ return '' + propValue;
16917
+ }
16892
16918
  var propType = getPropType(propValue);
16893
16919
  if (propType === 'object') {
16894
16920
  if (propValue instanceof Date) {
@@ -16900,6 +16926,23 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
16900
16926
  return propType;
16901
16927
  }
16902
16928
 
16929
+ // Returns a string that is postfixed to a warning about an invalid type.
16930
+ // For example, "undefined" or "of type array"
16931
+ function getPostfixForTypeWarning(value) {
16932
+ var type = getPreciseType(value);
16933
+ switch (type) {
16934
+ case 'array':
16935
+ case 'object':
16936
+ return 'an ' + type;
16937
+ case 'boolean':
16938
+ case 'date':
16939
+ case 'regexp':
16940
+ return 'a ' + type;
16941
+ default:
16942
+ return type;
16943
+ }
16944
+ }
16945
+
16903
16946
  // Returns class name of the object, if any.
16904
16947
  function getClassName(propValue) {
16905
16948
  if (!propValue.constructor || !propValue.constructor.name) {