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.
- package/README.md +0 -8
- package/addons.js +0 -3
- package/lib/AutoFocusMixin.js +32 -0
- package/lib/CSSCore.js +23 -22
- package/lib/CSSProperty.js +32 -1
- package/lib/CSSPropertyOperations.js +1 -1
- package/lib/ChangeEventPlugin.js +27 -5
- package/lib/ClientReactRootIndex.js +30 -0
- package/lib/CompositionEventPlugin.js +58 -10
- package/lib/DOMChildrenOperations.js +39 -3
- package/lib/DOMProperty.js +9 -5
- package/lib/DOMPropertyOperations.js +21 -8
- package/lib/Danger.js +9 -8
- package/lib/DefaultDOMPropertyConfig.js +23 -14
- package/lib/DefaultEventPluginOrder.js +1 -1
- package/lib/EnterLeaveEventPlugin.js +38 -5
- package/lib/EventConstants.js +4 -1
- package/lib/EventListener.js +42 -34
- package/lib/EventPluginHub.js +118 -13
- package/lib/EventPluginRegistry.js +62 -18
- package/lib/EventPluginUtils.js +33 -4
- package/lib/EventPropagators.js +7 -43
- package/lib/ExecutionEnvironment.js +4 -1
- package/lib/LinkedStateMixin.js +1 -1
- package/lib/LinkedValueUtils.js +160 -0
- package/lib/MobileSafariClickEventPlugin.js +1 -1
- package/lib/PooledClass.js +7 -1
- package/lib/React.js +30 -4
- package/lib/ReactBrowserComponentMixin.js +42 -0
- package/lib/ReactCSSTransitionGroup.js +65 -0
- package/lib/{ReactTransitionableChild.js → ReactCSSTransitionGroupChild.js} +22 -36
- package/lib/ReactChildren.js +4 -4
- package/lib/ReactComponent.js +163 -83
- package/lib/ReactComponentBrowserEnvironment.js +55 -71
- package/lib/ReactCompositeComponent.js +686 -119
- package/lib/ReactContext.js +67 -0
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/ReactDOM.js +19 -6
- package/lib/ReactDOMButton.js +6 -1
- package/lib/ReactDOMComponent.js +66 -24
- package/lib/ReactDOMForm.js +13 -3
- package/lib/ReactDOMIDOperations.js +106 -61
- package/lib/ReactDOMImg.js +61 -0
- package/lib/ReactDOMInput.js +28 -15
- package/lib/ReactDOMOption.js +13 -8
- package/lib/ReactDOMSelect.js +38 -18
- package/lib/ReactDOMSelection.js +1 -1
- package/lib/ReactDOMTextarea.js +19 -11
- package/lib/ReactDefaultBatchingStrategy.js +1 -1
- package/lib/ReactDefaultInjection.js +60 -26
- package/lib/ReactDefaultPerf.js +208 -371
- package/lib/ReactDefaultPerfAnalysis.js +199 -0
- package/lib/ReactErrorUtils.js +6 -15
- package/lib/ReactEventEmitter.js +144 -146
- package/lib/ReactEventEmitterMixin.js +1 -33
- package/lib/ReactEventTopLevelCallback.js +75 -15
- package/lib/ReactInjection.js +43 -0
- package/lib/ReactInputSelection.js +3 -2
- package/lib/ReactInstanceHandles.js +36 -20
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +136 -104
- package/lib/ReactMountReady.js +2 -2
- package/lib/ReactMultiChild.js +40 -49
- package/lib/ReactMultiChildUpdateTypes.js +3 -1
- package/lib/ReactOwner.js +17 -4
- package/lib/ReactPerf.js +6 -9
- package/lib/ReactPropTransferer.js +41 -22
- package/lib/ReactPropTypeLocationNames.js +31 -0
- package/lib/{ReactComponentEnvironment.js → ReactPropTypeLocations.js} +11 -6
- package/lib/ReactPropTypes.js +249 -48
- package/lib/ReactPutListenerQueue.js +61 -0
- package/lib/ReactReconcileTransaction.js +28 -7
- package/lib/ReactRootIndex.js +36 -0
- package/lib/ReactServerRendering.js +46 -19
- package/lib/ReactServerRenderingTransaction.js +116 -0
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +394 -0
- package/lib/ReactTextComponent.js +33 -6
- package/lib/{ReactTransitionKeySet.js → ReactTransitionChildMapping.js} +43 -48
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +133 -58
- package/lib/ReactUpdates.js +15 -12
- package/lib/ReactWithAddons.js +15 -3
- package/lib/SelectEventPlugin.js +23 -40
- package/lib/ServerReactRootIndex.js +36 -0
- package/lib/SimpleEventPlugin.js +55 -7
- package/lib/SyntheticClipboardEvent.js +8 -2
- package/lib/SyntheticCompositionEvent.js +1 -1
- package/lib/SyntheticDragEvent.js +44 -0
- package/lib/SyntheticEvent.js +3 -2
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticKeyboardEvent.js +5 -3
- package/lib/SyntheticMouseEvent.js +1 -1
- package/lib/SyntheticTouchEvent.js +1 -1
- package/lib/SyntheticUIEvent.js +1 -1
- package/lib/SyntheticWheelEvent.js +11 -8
- package/lib/Transaction.js +62 -37
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulate.js +1 -1
- package/lib/adler32.js +1 -1
- package/lib/cloneWithProps.js +59 -0
- package/lib/containsNode.js +1 -1
- package/lib/copyProperties.js +1 -1
- package/lib/createArrayFrom.js +11 -14
- package/lib/createFullPageComponent.js +63 -0
- package/lib/createNodesFromMarkup.js +1 -1
- package/lib/createObjectFrom.js +1 -1
- package/lib/cx.js +3 -3
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/emptyFunction.js +1 -1
- package/lib/emptyObject.js +27 -0
- package/lib/escapeTextForBrowser.js +1 -1
- package/lib/flattenChildren.js +6 -3
- package/lib/focusNode.js +33 -0
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getActiveElement.js +5 -4
- package/lib/getEventKey.js +85 -0
- package/lib/getEventTarget.js +1 -1
- package/lib/getMarkupWrap.js +11 -1
- package/lib/getNodeForCharacterOffset.js +1 -1
- package/lib/getReactRootElementInContainer.js +1 -1
- package/lib/getTextContentAccessor.js +6 -4
- package/lib/getUnboundedScrollPosition.js +3 -3
- package/lib/hyphenate.js +1 -1
- package/lib/instantiateReactComponent.js +70 -0
- package/lib/invariant.js +20 -12
- package/lib/isEventSupported.js +8 -12
- package/lib/isNode.js +2 -2
- package/lib/isTextInputElement.js +1 -1
- package/lib/isTextNode.js +1 -1
- package/lib/joinClasses.js +1 -1
- package/lib/keyMirror.js +1 -1
- package/lib/keyOf.js +1 -1
- package/lib/memoizeStringOnly.js +1 -1
- package/lib/merge.js +1 -1
- package/lib/mergeHelpers.js +6 -7
- package/lib/mergeInto.js +1 -1
- package/lib/mixInto.js +1 -1
- package/lib/monitorCodeUse.js +37 -0
- package/lib/objMap.js +1 -1
- package/lib/objMapKeyVal.js +1 -1
- package/lib/onlyChild.js +43 -0
- package/lib/performanceNow.js +1 -1
- package/lib/shallowEqual.js +1 -1
- package/lib/shouldUpdateReactComponent.js +61 -0
- package/lib/toArray.js +75 -0
- package/lib/traverseAllChildren.js +72 -9
- package/lib/update.js +159 -0
- package/lib/warning.js +48 -0
- package/package.json +3 -3
- package/react.js +0 -3
- package/ReactJSErrors.js +0 -40
- package/lib/$.js +0 -46
- package/lib/CallbackRegistry.js +0 -91
- package/lib/LinkedValueMixin.js +0 -68
- package/lib/ex.js +0 -49
- package/lib/filterAttributes.js +0 -45
- package/lib/ge.js +0 -76
- 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;
|
package/lib/createObjectFrom.js
CHANGED
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).
|
|
37
|
-
return classNames[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, ' ');
|
package/lib/emptyFunction.js
CHANGED
|
@@ -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;
|
package/lib/flattenChildren.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.
|
|
@@ -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
|
-
|
|
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) {
|
package/lib/focusNode.js
ADDED
|
@@ -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;
|
package/lib/getActiveElement.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.
|
|
@@ -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
|
|
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;
|
package/lib/getEventTarget.js
CHANGED
package/lib/getMarkupWrap.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.
|
|
@@ -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.
|
|
@@ -30,9 +30,11 @@ var contentKey = null;
|
|
|
30
30
|
*/
|
|
31
31
|
function getTextContentAccessor() {
|
|
32
32
|
if (!contentKey && ExecutionEnvironment.canUseDOM) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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:
|
|
36
|
-
y:
|
|
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