react 0.8.0 → 0.10.0

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 (160) hide show
  1. package/README.md +0 -8
  2. package/addons.js +0 -3
  3. package/lib/AutoFocusMixin.js +32 -0
  4. package/lib/CSSCore.js +23 -22
  5. package/lib/CSSProperty.js +32 -1
  6. package/lib/CSSPropertyOperations.js +1 -1
  7. package/lib/ChangeEventPlugin.js +27 -5
  8. package/lib/ClientReactRootIndex.js +30 -0
  9. package/lib/CompositionEventPlugin.js +58 -10
  10. package/lib/DOMChildrenOperations.js +39 -3
  11. package/lib/DOMProperty.js +9 -5
  12. package/lib/DOMPropertyOperations.js +21 -8
  13. package/lib/Danger.js +9 -8
  14. package/lib/DefaultDOMPropertyConfig.js +23 -14
  15. package/lib/DefaultEventPluginOrder.js +1 -1
  16. package/lib/EnterLeaveEventPlugin.js +38 -5
  17. package/lib/EventConstants.js +4 -1
  18. package/lib/EventListener.js +42 -34
  19. package/lib/EventPluginHub.js +118 -13
  20. package/lib/EventPluginRegistry.js +62 -18
  21. package/lib/EventPluginUtils.js +33 -4
  22. package/lib/EventPropagators.js +7 -43
  23. package/lib/ExecutionEnvironment.js +4 -1
  24. package/lib/LinkedStateMixin.js +1 -1
  25. package/lib/LinkedValueUtils.js +160 -0
  26. package/lib/MobileSafariClickEventPlugin.js +1 -1
  27. package/lib/PooledClass.js +7 -1
  28. package/lib/React.js +30 -4
  29. package/lib/ReactBrowserComponentMixin.js +42 -0
  30. package/lib/ReactCSSTransitionGroup.js +65 -0
  31. package/lib/{ReactTransitionableChild.js → ReactCSSTransitionGroupChild.js} +22 -36
  32. package/lib/ReactChildren.js +4 -4
  33. package/lib/ReactComponent.js +163 -83
  34. package/lib/ReactComponentBrowserEnvironment.js +55 -71
  35. package/lib/ReactCompositeComponent.js +686 -119
  36. package/lib/ReactContext.js +67 -0
  37. package/lib/ReactCurrentOwner.js +1 -1
  38. package/lib/ReactDOM.js +19 -6
  39. package/lib/ReactDOMButton.js +6 -1
  40. package/lib/ReactDOMComponent.js +66 -24
  41. package/lib/ReactDOMForm.js +13 -3
  42. package/lib/ReactDOMIDOperations.js +106 -61
  43. package/lib/ReactDOMImg.js +61 -0
  44. package/lib/ReactDOMInput.js +28 -15
  45. package/lib/ReactDOMOption.js +13 -8
  46. package/lib/ReactDOMSelect.js +38 -18
  47. package/lib/ReactDOMSelection.js +1 -1
  48. package/lib/ReactDOMTextarea.js +19 -11
  49. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  50. package/lib/ReactDefaultInjection.js +60 -26
  51. package/lib/ReactDefaultPerf.js +208 -371
  52. package/lib/ReactDefaultPerfAnalysis.js +199 -0
  53. package/lib/ReactErrorUtils.js +6 -15
  54. package/lib/ReactEventEmitter.js +144 -146
  55. package/lib/ReactEventEmitterMixin.js +1 -33
  56. package/lib/ReactEventTopLevelCallback.js +75 -15
  57. package/lib/ReactInjection.js +43 -0
  58. package/lib/ReactInputSelection.js +3 -2
  59. package/lib/ReactInstanceHandles.js +36 -20
  60. package/lib/ReactLink.js +2 -2
  61. package/lib/ReactMarkupChecksum.js +1 -1
  62. package/lib/ReactMount.js +136 -104
  63. package/lib/ReactMountReady.js +2 -2
  64. package/lib/ReactMultiChild.js +40 -49
  65. package/lib/ReactMultiChildUpdateTypes.js +3 -1
  66. package/lib/ReactOwner.js +17 -4
  67. package/lib/ReactPerf.js +6 -9
  68. package/lib/ReactPropTransferer.js +41 -22
  69. package/lib/ReactPropTypeLocationNames.js +31 -0
  70. package/lib/{ReactComponentEnvironment.js → ReactPropTypeLocations.js} +11 -6
  71. package/lib/ReactPropTypes.js +249 -48
  72. package/lib/ReactPutListenerQueue.js +61 -0
  73. package/lib/ReactReconcileTransaction.js +28 -7
  74. package/lib/ReactRootIndex.js +36 -0
  75. package/lib/ReactServerRendering.js +46 -19
  76. package/lib/ReactServerRenderingTransaction.js +116 -0
  77. package/lib/ReactStateSetters.js +1 -1
  78. package/lib/ReactTestUtils.js +394 -0
  79. package/lib/ReactTextComponent.js +33 -6
  80. package/lib/{ReactTransitionKeySet.js → ReactTransitionChildMapping.js} +43 -48
  81. package/lib/ReactTransitionEvents.js +1 -1
  82. package/lib/ReactTransitionGroup.js +133 -58
  83. package/lib/ReactUpdates.js +15 -12
  84. package/lib/ReactWithAddons.js +15 -3
  85. package/lib/SelectEventPlugin.js +23 -40
  86. package/lib/ServerReactRootIndex.js +36 -0
  87. package/lib/SimpleEventPlugin.js +55 -7
  88. package/lib/SyntheticClipboardEvent.js +8 -2
  89. package/lib/SyntheticCompositionEvent.js +1 -1
  90. package/lib/SyntheticDragEvent.js +44 -0
  91. package/lib/SyntheticEvent.js +3 -2
  92. package/lib/SyntheticFocusEvent.js +1 -1
  93. package/lib/SyntheticKeyboardEvent.js +5 -3
  94. package/lib/SyntheticMouseEvent.js +1 -1
  95. package/lib/SyntheticTouchEvent.js +1 -1
  96. package/lib/SyntheticUIEvent.js +1 -1
  97. package/lib/SyntheticWheelEvent.js +11 -8
  98. package/lib/Transaction.js +62 -37
  99. package/lib/ViewportMetrics.js +1 -1
  100. package/lib/accumulate.js +1 -1
  101. package/lib/adler32.js +1 -1
  102. package/lib/cloneWithProps.js +59 -0
  103. package/lib/containsNode.js +1 -1
  104. package/lib/copyProperties.js +1 -1
  105. package/lib/createArrayFrom.js +11 -14
  106. package/lib/createFullPageComponent.js +63 -0
  107. package/lib/createNodesFromMarkup.js +1 -1
  108. package/lib/createObjectFrom.js +1 -1
  109. package/lib/cx.js +3 -3
  110. package/lib/dangerousStyleValue.js +1 -1
  111. package/lib/emptyFunction.js +1 -1
  112. package/lib/emptyObject.js +27 -0
  113. package/lib/escapeTextForBrowser.js +1 -1
  114. package/lib/flattenChildren.js +6 -3
  115. package/lib/focusNode.js +33 -0
  116. package/lib/forEachAccumulated.js +1 -1
  117. package/lib/getActiveElement.js +5 -4
  118. package/lib/getEventKey.js +85 -0
  119. package/lib/getEventTarget.js +1 -1
  120. package/lib/getMarkupWrap.js +11 -1
  121. package/lib/getNodeForCharacterOffset.js +1 -1
  122. package/lib/getReactRootElementInContainer.js +1 -1
  123. package/lib/getTextContentAccessor.js +6 -4
  124. package/lib/getUnboundedScrollPosition.js +3 -3
  125. package/lib/hyphenate.js +1 -1
  126. package/lib/instantiateReactComponent.js +70 -0
  127. package/lib/invariant.js +20 -12
  128. package/lib/isEventSupported.js +8 -12
  129. package/lib/isNode.js +2 -2
  130. package/lib/isTextInputElement.js +1 -1
  131. package/lib/isTextNode.js +1 -1
  132. package/lib/joinClasses.js +1 -1
  133. package/lib/keyMirror.js +1 -1
  134. package/lib/keyOf.js +1 -1
  135. package/lib/memoizeStringOnly.js +1 -1
  136. package/lib/merge.js +1 -1
  137. package/lib/mergeHelpers.js +6 -7
  138. package/lib/mergeInto.js +1 -1
  139. package/lib/mixInto.js +1 -1
  140. package/lib/monitorCodeUse.js +37 -0
  141. package/lib/objMap.js +1 -1
  142. package/lib/objMapKeyVal.js +1 -1
  143. package/lib/onlyChild.js +43 -0
  144. package/lib/performanceNow.js +1 -1
  145. package/lib/shallowEqual.js +1 -1
  146. package/lib/shouldUpdateReactComponent.js +61 -0
  147. package/lib/toArray.js +75 -0
  148. package/lib/traverseAllChildren.js +72 -9
  149. package/lib/update.js +159 -0
  150. package/lib/warning.js +48 -0
  151. package/package.json +3 -3
  152. package/react.js +0 -3
  153. package/ReactJSErrors.js +0 -40
  154. package/lib/$.js +0 -46
  155. package/lib/CallbackRegistry.js +0 -91
  156. package/lib/LinkedValueMixin.js +0 -68
  157. package/lib/ex.js +0 -49
  158. package/lib/filterAttributes.js +0 -45
  159. package/lib/ge.js +0 -76
  160. package/lib/mutateHTMLNodeWithMarkup.js +0 -100
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Copyright 2013-2014 Facebook, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ * @providesModule createFullPageComponent
17
+ * @typechecks
18
+ */
19
+
20
+ "use strict";
21
+
22
+ // Defeat circular references by requiring this directly.
23
+ var ReactCompositeComponent = require("./ReactCompositeComponent");
24
+
25
+ var invariant = require("./invariant");
26
+
27
+ /**
28
+ * Create a component that will throw an exception when unmounted.
29
+ *
30
+ * Components like <html> <head> and <body> can't be removed or added
31
+ * easily in a cross-browser way, however it's valuable to be able to
32
+ * take advantage of React's reconciliation for styling and <title>
33
+ * management. So we just document it and throw in dangerous cases.
34
+ *
35
+ * @param {function} componentClass convenience constructor to wrap
36
+ * @return {function} convenience constructor of new component
37
+ */
38
+ function createFullPageComponent(componentClass) {
39
+ var FullPageComponent = ReactCompositeComponent.createClass({
40
+ displayName: 'ReactFullPageComponent' + (
41
+ componentClass.componentConstructor.displayName || ''
42
+ ),
43
+
44
+ componentWillUnmount: function() {
45
+ ("production" !== process.env.NODE_ENV ? invariant(
46
+ false,
47
+ '%s tried to unmount. Because of cross-browser quirks it is ' +
48
+ 'impossible to unmount some top-level components (eg <html>, <head>, ' +
49
+ 'and <body>) reliably and efficiently. To fix this, have a single ' +
50
+ 'top-level component that never unmounts render these elements.',
51
+ this.constructor.displayName
52
+ ) : invariant(false));
53
+ },
54
+
55
+ render: function() {
56
+ return this.transferPropsTo(componentClass(null, this.props.children));
57
+ }
58
+ });
59
+
60
+ return FullPageComponent;
61
+ }
62
+
63
+ module.exports = createFullPageComponent;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/cx.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,8 @@
33
33
  */
34
34
  function cx(classNames) {
35
35
  if (typeof classNames == 'object') {
36
- return Object.keys(classNames).map(function(className) {
37
- return classNames[className] ? className : '';
36
+ return Object.keys(classNames).filter(function(className) {
37
+ return classNames[className];
38
38
  }).join(' ');
39
39
  } else {
40
40
  return Array.prototype.join.call(arguments, ' ');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright 2013-2014 Facebook, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ * @providesModule emptyObject
17
+ */
18
+
19
+ "use strict";
20
+
21
+ var emptyObject = {};
22
+
23
+ if ("production" !== process.env.NODE_ENV) {
24
+ Object.freeze(emptyObject);
25
+ }
26
+
27
+ module.exports = emptyObject;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -35,11 +35,14 @@ function flattenSingleChildIntoContext(traverseContext, child, name) {
35
35
  'Children keys must be unique.',
36
36
  name
37
37
  ) : invariant(!result.hasOwnProperty(name)));
38
- result[name] = child;
38
+ if (child != null) {
39
+ result[name] = child;
40
+ }
39
41
  }
40
42
 
41
43
  /**
42
- * Flattens children that are typically specified as `props.children`.
44
+ * Flattens children that are typically specified as `props.children`. Any null
45
+ * children will not be included in the resulting object.
43
46
  * @return {!object} flattened children keyed by name.
44
47
  */
45
48
  function flattenChildren(children) {
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright 2014 Facebook, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ * @providesModule focusNode
17
+ */
18
+
19
+ "use strict";
20
+
21
+ /**
22
+ * IE8 throws if an input/textarea is disabled and we try to focus it.
23
+ * Focus only when necessary.
24
+ *
25
+ * @param {DOMElement} node input/textarea to focus
26
+ */
27
+ function focusNode(node) {
28
+ if (!node.disabled) {
29
+ node.focus();
30
+ }
31
+ }
32
+
33
+ module.exports = focusNode;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -20,14 +20,15 @@
20
20
  /**
21
21
  * Same as document.activeElement but wraps in a try-catch block. In IE it is
22
22
  * not safe to call document.activeElement if there is nothing focused.
23
+ *
24
+ * The activeElement will be null only if the document body is not yet defined.
23
25
  */
24
26
  function getActiveElement() /*?DOMElement*/ {
25
27
  try {
26
- return document.activeElement;
28
+ return document.activeElement || document.body;
27
29
  } catch (e) {
28
- return null;
30
+ return document.body;
29
31
  }
30
32
  }
31
33
 
32
34
  module.exports = getActiveElement;
33
-
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Copyright 2013-2014 Facebook, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ * @providesModule getEventKey
17
+ * @typechecks static-only
18
+ */
19
+
20
+ "use strict";
21
+
22
+ /**
23
+ * Normalization of deprecated HTML5 "key" values
24
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
25
+ */
26
+ var normalizeKey = {
27
+ 'Esc': 'Escape',
28
+ 'Spacebar': ' ',
29
+ 'Left': 'ArrowLeft',
30
+ 'Up': 'ArrowUp',
31
+ 'Right': 'ArrowRight',
32
+ 'Down': 'ArrowDown',
33
+ 'Del': 'Delete',
34
+ 'Win': 'OS',
35
+ 'Menu': 'ContextMenu',
36
+ 'Apps': 'ContextMenu',
37
+ 'Scroll': 'ScrollLock',
38
+ 'MozPrintableKey': 'Unidentified'
39
+ };
40
+
41
+ /**
42
+ * Translation from legacy "which/keyCode" to HTML5 "key"
43
+ * Only special keys supported, all others depend on keyboard layout or browser
44
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
45
+ */
46
+ var translateToKey = {
47
+ 8: 'Backspace',
48
+ 9: 'Tab',
49
+ 12: 'Clear',
50
+ 13: 'Enter',
51
+ 16: 'Shift',
52
+ 17: 'Control',
53
+ 18: 'Alt',
54
+ 19: 'Pause',
55
+ 20: 'CapsLock',
56
+ 27: 'Escape',
57
+ 32: ' ',
58
+ 33: 'PageUp',
59
+ 34: 'PageDown',
60
+ 35: 'End',
61
+ 36: 'Home',
62
+ 37: 'ArrowLeft',
63
+ 38: 'ArrowUp',
64
+ 39: 'ArrowRight',
65
+ 40: 'ArrowDown',
66
+ 45: 'Insert',
67
+ 46: 'Delete',
68
+ 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
69
+ 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
70
+ 144: 'NumLock',
71
+ 145: 'ScrollLock',
72
+ 224: 'Meta'
73
+ };
74
+
75
+ /**
76
+ * @param {object} nativeEvent Native browser event.
77
+ * @return {string} Normalized `key` property.
78
+ */
79
+ function getEventKey(nativeEvent) {
80
+ return 'key' in nativeEvent ?
81
+ normalizeKey[nativeEvent.key] || nativeEvent.key :
82
+ translateToKey[nativeEvent.which || nativeEvent.keyCode] || 'Unidentified';
83
+ }
84
+
85
+ module.exports = getEventKey;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -36,11 +36,16 @@ var shouldWrap = {
36
36
  // Force wrapping for SVG elements because if they get created inside a <div>,
37
37
  // they will be initialized in the wrong namespace (and will not display).
38
38
  'circle': true,
39
+ 'defs': true,
39
40
  'g': true,
40
41
  'line': true,
42
+ 'linearGradient': true,
41
43
  'path': true,
44
+ 'polygon': true,
42
45
  'polyline': true,
46
+ 'radialGradient': true,
43
47
  'rect': true,
48
+ 'stop': true,
44
49
  'text': true
45
50
  };
46
51
 
@@ -72,11 +77,16 @@ var markupWrap = {
72
77
  'th': trWrap,
73
78
 
74
79
  'circle': svgWrap,
80
+ 'defs': svgWrap,
75
81
  'g': svgWrap,
76
82
  'line': svgWrap,
83
+ 'linearGradient': svgWrap,
77
84
  'path': svgWrap,
85
+ 'polygon': svgWrap,
78
86
  'polyline': svgWrap,
87
+ 'radialGradient': svgWrap,
79
88
  'rect': svgWrap,
89
+ 'stop': svgWrap,
80
90
  'text': svgWrap
81
91
  };
82
92
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -30,9 +30,11 @@ var contentKey = null;
30
30
  */
31
31
  function getTextContentAccessor() {
32
32
  if (!contentKey && ExecutionEnvironment.canUseDOM) {
33
- contentKey = 'innerText' in document.createElement('div') ?
34
- 'innerText' :
35
- 'textContent';
33
+ // Prefer textContent to innerText because many browsers support both but
34
+ // SVG <text> elements don't support innerText even when <div> does.
35
+ contentKey = 'textContent' in document.createElement('div') ?
36
+ 'textContent' :
37
+ 'innerText';
36
38
  }
37
39
  return contentKey;
38
40
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -32,8 +32,8 @@
32
32
  function getUnboundedScrollPosition(scrollable) {
33
33
  if (scrollable === window) {
34
34
  return {
35
- x: document.documentElement.scrollLeft || document.body.scrollLeft,
36
- y: document.documentElement.scrollTop || document.body.scrollTop
35
+ x: window.pageXOffset || document.documentElement.scrollLeft,
36
+ y: window.pageYOffset || document.documentElement.scrollTop
37
37
  };
38
38
  }
39
39
  return {
package/lib/hyphenate.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.