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.
package/dist/react-dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ReactDOM v15.6.0
2
+ * ReactDOM 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;
@@ -13057,7 +13059,7 @@ module.exports = ReactUpdates;
13057
13059
 
13058
13060
  'use strict';
13059
13061
 
13060
- module.exports = '15.6.0';
13062
+ module.exports = '15.6.1';
13061
13063
  },{}],84:[function(_dereq_,module,exports){
13062
13064
  /**
13063
13065
  * Copyright 2013-present, Facebook, Inc.
@@ -15117,7 +15119,7 @@ var styleWarnings = {};
15117
15119
  * @param {ReactDOMComponent} component
15118
15120
  * @return {string} Normalized style value with dimensions applied.
15119
15121
  */
15120
- function dangerousStyleValue(name, value, component) {
15122
+ function dangerousStyleValue(name, value, component, isCustomProperty) {
15121
15123
  // Note that we've removed escapeTextForBrowser() calls here since the
15122
15124
  // whole string will be escaped when the attribute is injected into
15123
15125
  // the markup. If you provide unsafe user data here they can inject
@@ -15134,7 +15136,7 @@ function dangerousStyleValue(name, value, component) {
15134
15136
  }
15135
15137
 
15136
15138
  var isNonNumeric = isNaN(value);
15137
- if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
15139
+ if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
15138
15140
  return '' + value; // cast to string
15139
15141
  }
15140
15142
 
@@ -16036,10 +16038,11 @@ var inputValueTracking = {
16036
16038
 
16037
16039
  var currentValue = '' + node[valueField];
16038
16040
 
16039
- // if someone has already defined a value bail and don't track value
16040
- // will cause over reporting of changes, but it's better then a hard failure
16041
- // (needed for certain tests that spyOn input values)
16042
- if (node.hasOwnProperty(valueField)) {
16041
+ // if someone has already defined a value or Safari, then bail
16042
+ // and don't track value will cause over reporting of changes,
16043
+ // but it's better then a hard failure
16044
+ // (needed for certain tests that spyOn input values and Safari)
16045
+ if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
16043
16046
  return;
16044
16047
  }
16045
16048
 
@@ -18725,6 +18728,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
18725
18728
  function createChainableTypeChecker(validate) {
18726
18729
  if ("development" !== 'production') {
18727
18730
  var manualPropTypeCallCache = {};
18731
+ var manualPropTypeWarningCount = 0;
18728
18732
  }
18729
18733
  function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
18730
18734
  componentName = componentName || ANONYMOUS;
@@ -18742,7 +18746,11 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
18742
18746
  } else if ("development" !== 'production' && typeof console !== 'undefined') {
18743
18747
  // Old behavior for people using React.PropTypes
18744
18748
  var cacheKey = componentName + ':' + propName;
18745
- if (!manualPropTypeCallCache[cacheKey]) {
18749
+ if (
18750
+ !manualPropTypeCallCache[cacheKey] &&
18751
+ // Avoid spamming the console because they are often not actionable except for lib authors
18752
+ manualPropTypeWarningCount < 3
18753
+ ) {
18746
18754
  warning(
18747
18755
  false,
18748
18756
  'You are manually calling a React.PropTypes validation ' +
@@ -18754,6 +18762,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
18754
18762
  componentName
18755
18763
  );
18756
18764
  manualPropTypeCallCache[cacheKey] = true;
18765
+ manualPropTypeWarningCount++;
18757
18766
  }
18758
18767
  }
18759
18768
  }
@@ -18891,6 +18900,20 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
18891
18900
  return emptyFunction.thatReturnsNull;
18892
18901
  }
18893
18902
 
18903
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
18904
+ var checker = arrayOfTypeCheckers[i];
18905
+ if (typeof checker !== 'function') {
18906
+ warning(
18907
+ false,
18908
+ 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
18909
+ 'received %s at index %s.',
18910
+ getPostfixForTypeWarning(checker),
18911
+ i
18912
+ );
18913
+ return emptyFunction.thatReturnsNull;
18914
+ }
18915
+ }
18916
+
18894
18917
  function validate(props, propName, componentName, location, propFullName) {
18895
18918
  for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
18896
18919
  var checker = arrayOfTypeCheckers[i];
@@ -19023,6 +19046,9 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
19023
19046
  // This handles more types than `getPropType`. Only used for error messages.
19024
19047
  // See `createPrimitiveTypeChecker`.
19025
19048
  function getPreciseType(propValue) {
19049
+ if (typeof propValue === 'undefined' || propValue === null) {
19050
+ return '' + propValue;
19051
+ }
19026
19052
  var propType = getPropType(propValue);
19027
19053
  if (propType === 'object') {
19028
19054
  if (propValue instanceof Date) {
@@ -19034,6 +19060,23 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
19034
19060
  return propType;
19035
19061
  }
19036
19062
 
19063
+ // Returns a string that is postfixed to a warning about an invalid type.
19064
+ // For example, "undefined" or "of type array"
19065
+ function getPostfixForTypeWarning(value) {
19066
+ var type = getPreciseType(value);
19067
+ switch (type) {
19068
+ case 'array':
19069
+ case 'object':
19070
+ return 'an ' + type;
19071
+ case 'boolean':
19072
+ case 'date':
19073
+ case 'regexp':
19074
+ return 'a ' + type;
19075
+ default:
19076
+ return type;
19077
+ }
19078
+ }
19079
+
19037
19080
  // Returns class name of the object, if any.
19038
19081
  function getClassName(propValue) {
19039
19082
  if (!propValue.constructor || !propValue.constructor.name) {