Commit Graph

995 Commits

Author SHA1 Message Date
Pete Hunt e1c2d02fdd Create ReactEventListener
Per our discussion friday, this creates ReactEventListener and renames variables to use the "handle"
nomenclature.
2014-06-14 20:38:45 -07:00
Marshall Roch a6cd945d9f Fix 'this' in static methods
binds static methods on the descriptor to the component's actual constructor, so that `foo.constructor.bar()` and `Foo.bar()` run with the same `this`.
2014-06-14 20:37:51 -07:00
Tim Yung 431155d2e2 Revert #1536
It's causing issues in product code. Reverting until it can be
investigated further.
2014-06-14 20:36:07 -07:00
Kunal Mehta 0f7423f31d Merge pull request #1661 from spicyj/test-ie10-select-multiple
Fix select switching to multiple in IE
2014-06-13 14:24:50 -07:00
Cheng Lou 3eb36415bd Merge pull request #1206 from brandonbloom/apply
$apply directive for update
2014-06-12 20:34:29 -07:00
Cheng Lou 4329d5ac38 Merge pull request #1611 from mathieumg/master
Added 'objectOf' PropType validator to iterate on objects and validate properties.
2014-06-12 20:19:33 -07:00
Brandon Bloom 86161c9c48 $apply command for update 2014-06-12 23:10:14 -04:00
Mathieu M-Gosselin 4852c30d62 Added 'objectOf' PropType validator to iterate on object literals and
validate properties.
2014-06-11 21:12:05 -04:00
Cheng Lou 303a719f92 Merge pull request #1658 from spicyj/test-ie10-submit-label
Fix submit-button value test in IE10
2014-06-11 13:44:27 -07:00
Cheng Lou 9eff32c80c Merge pull request #1659 from spicyj/test-ie10-iframe
Fix EnterLeaveEventPlugin-test in IE10
2014-06-11 13:44:16 -07:00
Cheng Lou 92c174fec8 Merge pull request #1671 from gasi/fix-unset-style
Prevent null reference access when unsetting styles
2014-06-11 11:27:37 -07:00
Cheng Lou 36f2999d47 Merge pull request #1660 from spicyj/test-ie10-proptypesname
Fix PropTypes test in IE10
2014-06-11 10:34:28 -07:00
Ben Alpert 8e2dcceee3 Merge pull request #1597 from spicyj/defaultprops-autobind
Auto-bind before getDefaultProps
2014-06-11 10:14:31 -07:00
Daniel Gasienica 7c2dec5bd3 Prevent null reference access when unsetting styles 2014-06-10 13:33:32 -07:00
Ben Alpert eaa68b8e6b Fix select switching to multiple in IE
This one was an actual behavioral bug rather than a bug with the tests; our intention was that the first element from the `defaultValue` array would remain selected but IE seemed to be choosing the last one instead. Now we set the value for uncontrolled components in componentDidUpdate when switching from multiple to non-multiple to ensure that a consistent option gets selected.

Test Plan: Ran the ReactDOMSelect tests in jest, phantomjs, IE10, Chrome, and Firefox. Also tested an uncontrolled select manually to make sure that nothing crazy happened when switching between options.
2014-06-07 19:16:34 -07:00
Ben Alpert 7cd5e9b399 Fix PropTypes test in IE10
Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox.
2014-06-07 18:56:28 -07:00
Ben Alpert 5790a75622 Fix submit-button value test in IE10
Test Plan: Ran test in jest, phantomjs, IE10, Chrome, and Firefox.
2014-06-07 18:50:29 -07:00
Ben Alpert e938116549 Fix EnterLeaveEventPlugin-test in IE10
Previously this was failing because iframeDocument.body wasn't properly initialized. Creating the document this way seems to work in all environments

Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox.
2014-06-07 18:45:32 -07:00
cpojer eebcf9f888 Fix ExecutionEnvironment.canUseDOM for IE8. 2014-06-05 12:44:24 -07:00
Ben Alpert e501238c10 Fix getEventModifierState, no allocations
Alternative to #1637 that doesn't allocate on every event.

Test Plan: Crossed fingers.
2014-06-03 14:35:29 -07:00
Ben Alpert 3e34739cb9 Fix onLoad and onError on images
Fixes bug introduced in c62c2c5.

Test Plan: Tested that the onLoad event was properly triggered on an image. Didn't test onError but I can only assume that it works equally well.
2014-05-30 16:53:46 -07:00
Fred Zhao 50516585a4 Update findComponentRoot and processUpdates warnings for SVG
I ran into a really difficult-to-debug issue with a React app with SVG
elements. Christopher sat down with me for a while and we finally figured out
that the browser was moving non-SVG elements out of a parent `<svg>` node which
triggered the `processUpdates()` invariant. This updates the error message
thrown from there to include this scenario in the possible issues list.
2014-05-28 18:19:49 -07:00
Paul O’Shannessy 6c7abd36dd Sync upstream modules
crateObjectFrom is no longer used (was used in ReactPropTypes). Others are small changes.
2014-05-28 15:13:02 -07:00
Paul O’Shannessy 0ad8cfad1a Merge pull request #1590 from spicyj/svg-classname
Handle className properly on SVG nodes
2014-05-28 10:14:59 -07:00
Timothy Yung bca1f0e352 Merge pull request #1536 from spicyj/gh-1169
Attach empty onclick listener to each node
2014-05-27 16:44:08 -04:00
Ben Alpert e096000bb5 Attach empty onclick listener to each node
Fixes #1169.

This is a more robust way of fixing what MobileSafariClickPlugin previously tried to. Now even if you don't want anything to do with touch events, click events still work properly.

Test Plan: Added a click handler to an `<img />` element and triggered it in the iOS simulator -- it didn't execute before.
2014-05-27 13:40:17 -07:00
Ben Alpert 8a460ba2e8 Auto-bind before getDefaultProps
Fixes #1595.
2014-05-25 00:40:39 -07:00
Paul O'Shannessy 7a9b81ef55 remove spurios module ref
long long ago in a galaxy far away this was probably a dependency
2014-05-23 15:35:22 -07:00
Paul O'Shannessy c62c2c59bb Remove event listeners from native dom wrapper components
Not removing them resulted in leaks as we would hold on to removed nodes forever.

This really showed up with images and the load event where we would unmount and create a new img with the same react id as the old one. We properly cleared and primed the caches but we would handle the load event for both nodes. We would eventually hit an invariant in that path as we tried to handle the event for the removed node, which no longer matched the node we had in the cache.

By forcefully removing the listener, we'll avoid this problem entirely and we should leak fewer DOM nodes.
2014-05-23 11:30:19 -07:00
Ben Alpert 37f61c479e Handle className properly on SVG nodes
This strategy avoids a runtime check for every set (as opposed to using a mutation method).

Test Plan: Verify that changing className works on a div and a rect in latest Chrome, latest Firefox, IE9. Verify that the div works in IE8.
2014-05-22 20:31:04 -07:00
Paul O’Shannessy f9ad17db65 Merge pull request #1363 from spicyj/batch-all
Batch subupdates caused by any state update
2014-05-22 15:28:48 -07:00
Ian Obermiller bf5dfc87dc Error in extractEvents
If the event is on the window object, topScroll, for instance, the topLevelTarget will not have getAttribute defined. Restore the previous `|| !topLevelTarget.attributes` check to avoid an error on every scroll.
2014-05-21 15:12:26 -07:00
Paul O’Shannessy c6309567c9 Merge pull request #1559 from spicyj/gh-1376
Allow unmounting title tag
2014-05-20 11:23:36 -07:00
Paul O’Shannessy e63eab111c Merge pull request #1553 from givingstage/invalid_checksum_warning_spacing
Fixed spacing of invalid checksum warning
2014-05-20 11:23:19 -07:00
Ben Alpert 4e5ed8317b Switch style test to pass in jsdom
This should be testing approximately the same thing and passes in Jest.

Test Plan: Cherry-pick Jest config from #1528 and verify that running `jest`.
2014-05-19 16:56:30 -07:00
Ben Alpert e17086e5df Add componentWillReceiveProps setState test 2014-05-19 15:58:40 -07:00
Ben Alpert 550795445e Use Object.prototype.hasOwnProperty for doc in IE8
Test Plan: Loaded ballmer-peak example in IE8 without errors and interacted with the text field.
2014-05-19 13:09:47 -07:00
Paul O’Shannessy 0c6bee049e Merge pull request #1189 from spicyj/hasown
Add hasOwnProperty checks where appropriate
2014-05-19 09:38:56 -07:00
Ben Alpert 4935d04d50 Allow unmounting title tag
cf. #1376.

This is useful for SVG. Dynamically adding and removing `<title>` elements in SVG still won't work properly because of getMarkupWrap but this at least lets you include it in initial render and then unmount the entire `<svg>` without problems.
2014-05-18 23:19:51 -07:00
Thomas Shafer 0a7128c70f Fixed spacing of invalid checksum warning 2014-05-17 20:04:52 -07:00
Ben Alpert 6c331fba07 Add hasOwnProperty checks where appropriate
For boolean-like objects, I've added hasOwnProperty checks in addition to the existing truthiness check even though for most of these dicts, we leave out false keys instead of setting them explicitly to false.

In DOMPropertyOperations, we don't need to check hasOwnProperty if the property is in isStandardName because (with the exception of getPossibleStandardName) the dicts on DOMProperty will now be consistently populated with every valid attribute.
2014-05-16 10:59:51 -07:00
Paul O’Shannessy 4558e2c4bc Merge pull request #1491 from naturalatlas/itemscope
Added support for itemscope, itemtype, itemprop attributes.
2014-05-15 14:48:51 -07:00
Cheng Lou 80a5463a2c Remove filterAttributes.js
This is no longer needed because of https://github.com/facebook/react/commit/089a494a1f0cc1892f1525fd746bac10c5a55175

mutateHTMLNodeWithMarkup.js was the only one using it.
2014-05-15 14:14:38 -04:00
Pete Hunt b66202eb98 Merge pull request #1487 from somethingkindawierd/master
Adds svg mask and pattern dom components
2014-05-13 11:28:59 -07:00
Ben Alpert 808a54f410 Batch subupdates caused by any state update
With this, multiple setState calls triggered by a componentDidUpdate handler (or similar) will be batched together, regardless of if the original setState call was in a batching context.

I also cleaned up some inconsistencies with the order of component updates and callbacks in situations where one component's update directly causes another to update.

Fixes #1147. Helps with #1353 and #1245 as well, though doesn't completely fix them yet.

Test Plan:
grunt test
2014-05-13 10:50:26 -07:00
Paul O’Shannessy a00199ddd2 Merge pull request #1358 from spicyj/one-transaction
Share reconcile transaction in batched updates
2014-05-13 10:47:03 -07:00
Josh Duck 29f3f74c52 Make perf show all exclusive time, not just render time.
Currently require('ReactDefaultPerf').printExclusive() shows render
time and aggregate componentMount time.

This makes it show exclusive mount time by tracking a stack.
2014-05-12 16:39:09 -07:00
Pete Hunt e4f80f301d Merge pull request #1516 from syranide/es5err
Preemptively error when required ES5 shim/shams are not available
2014-05-12 13:40:00 -07:00
Andreas Svensson 659b7981e1 Preemptively error when required ES5 shim/shams are not available 2014-05-11 21:20:07 +02:00
Brian Reavis f399b68201 Stylistic changes. 2014-05-08 23:25:10 -07:00