Commit Graph

410 Commits

Author SHA1 Message Date
Brian Kim e707ec0b1e Fix failing tests
Two of your tests were failing because of commit
1e71df5399
I fixed them by:
1) Using jasmine's spyOn in ReactCompositeComponentError-test.js
2) Inverting the function wrapping in the above commit.
Godspeed.
2013-11-13 05:07:52 -05:00
Tim Yung 9fd28f44df Rename nodeContains to containsNode 2013-11-11 16:39:25 -08:00
Mouad Debbar 1ffe2d0927 Add support for oncontextmenu in React. 2013-11-11 16:39:25 -08:00
Marshall Roch 735b4f0b7c Remove transaction from componentWillUpdate
It wasn't documented and I think the transaction is supposed to be internal.
2013-11-11 16:39:25 -08:00
Felix Kling 1e71df5399 Improve error logging for event handlers of React components.
This guards every auto-bound method and uses the name of the component and method as guard name.
2013-11-11 16:39:25 -08:00
Andreas Svensson 62f7cd213f Fix wheelDelta misspelled 2013-11-10 16:58:55 +01:00
Ben Newman b3c87ea017 Merge pull request #451 from subtleGradient/subtlegradient/browser-testing
Browser testing.
2013-11-07 10:20:58 -08:00
Paul O’Shannessy 192af01952 Merge pull request #488 from spicyj/gh-473
Make submit button default value appear correctly
2013-11-06 22:56:19 -08:00
Ben Alpert d5c2d5f291 Make submit button default value appear correctly
Fixes #473.
2013-11-06 21:19:44 -08:00
Ben Alpert 4fe784de1f Make propTypes DEFINE_MANY_MERGED 2013-11-06 17:13:25 -08:00
Thomas Aylott 5640d641d6 skip Worker test unless the browser supports them 2013-11-06 15:30:49 -05:00
Thomas Aylott 8205c681eb serve worker.js from its actual relative path 2013-11-06 15:30:49 -05:00
Paul Shen 0fed861424 Move merge utility functions from utils to vendor/core 2013-11-05 17:17:47 -08:00
Tim Yung e78d580c06 Include Ownership in the Ship of Theseus
When we determine whether a React component should be updated (as opposed to destroyed or replaced), we currently only look at whether they share the same constructor. This adds a check for whether they share the same owner component.

I've also consolidated this logic (I cannot believe this was not already done).
2013-11-05 17:14:57 -08:00
Paul O’Shannessy 5dad5e92a9 Merge pull request #476 from SanderSpies/unused-onselect
Removing unused useSelect variable.
2013-11-05 15:17:45 -08:00
SanderSpies 27fa1f5c9c Removing 'isEventSupported' 2013-11-05 22:53:50 +01:00
SanderSpies dede55d27d Removing unused useSelect variable. 2013-11-05 22:45:02 +01:00
Laurence Rowe 1bcca22719 Script async and defer properties 2013-11-04 20:40:53 -08:00
Paul O’Shannessy da5c61afe4 Oxford comma 2013-11-04 11:34:56 -08:00
Josh Duck 18bf0b80bc Fix ReactDOMSelection for IE 11
IE 11 no longer supports the legacy document.selection API.
Their implementation of window.getSelection() doesn't support
the extend() method, which we were relying on.

If the selection is RTL and selection extend is missing, then just
flip the selection.
2013-11-04 11:34:39 -08:00
Matti Nelimarkka 9e24257a4e Clear error message when rendering a nonvalid component 2013-11-01 17:32:09 -07:00
Tim Yung 0dc011c40c Better getUnboundedScrollPosition for windows
Instead of using browser sniffing, `getUnboundedScrollPosition` can do
better and not have to depend on the `getDocumentScrollElement` module.
2013-10-31 15:24:58 -07:00
Paul O'Shannessy 2cf7d943df Reorder DefaultDOMPropertyConfig
`autoCorrect` belongs with the non-standard properties list.
2013-10-30 16:58:05 -07:00
Mark Richardson 9b44ad6ce5 Add autoCorrect to list of supported DOM properties 2013-10-30 16:57:53 -07:00
Tim Yung 7789a32438 Forward Compatibility w/ WebKit & Blink
Newer versions of WebKit and Blink will support both `document.body.scrollTop` and `document.documentElement.scrollTop`. Therefore, implementing cross-browser compatibility by summing the two will no longer work.

This changes React to use `getUnboundedScrollPosition` so we get the fix and consistency in one change!

See: https://rniwa.com/2013-10-29/web-compatibility-story-of-scrolltop-and-scrollleft/
2013-10-30 16:56:55 -07:00
Laurence Rowe 280eff41f3 Make 'disabled' MUST_USE_ATTRIBUTE for compatibility with CSS [disabled] selectors.
When a ReactDOMComponent is created with the property `disabled: true` subsequently setting the property to `disabled: false` the HTML attribute `disabled="true"` was being left in the DOM.
2013-10-28 18:53:19 -07:00
Paul O’Shannessy 214e9103bf Merge pull request #423 from andreypopp/master
Re-rendering components into a document leaks components
2013-10-28 17:00:19 -07:00
Andrey Popp ac9dd92272 Fix unmounting components mounted into doc element
If we are to unmount a component mounted into a document element we should
unmount it from document.documentElement and not from document.firstChild which
is a doctype element in this specific case.
2013-10-29 02:49:00 +04:00
Ian Obermiller fbb741febb Fix ReactTransitionEvents detectEvents 2013-10-25 18:11:58 -07:00
Cat Chen 0ef1ca0024 fixed %d in invariant call 2013-10-25 18:03:26 -07:00
Josh Duck 0d2d3360d0 Don't reset mouseDown in focus handlers
Focus fires after mouse down on initial click, so we lost the
flag when the user initially began dragging on the input.
2013-10-22 14:09:33 -07:00
Tim Yung 58b3ae3136 Use Default Value for Undefined Props
Currently, default props as defined by `getDefaultProps` are only used if a prop is not specified (using `X in Y` check).

However, this makes it difficult for composing components to pass along the state of not being defined, for example:

  render: function() {
    // If `this.props.someProp` is not set, `InnerThing` should use the default value.
    return <InnerThing someProp={this.props.someProp} />;
  }

This changes the requirement for falling back to the default value to an undefined check (using `typeof X === 'undefined'`).
2013-10-21 13:17:44 -07:00
Ben Alpert 893fba8373 Make SelectEventPlugin not throw for range inputs
Accessing .selectionStart on a non-text input will throw (see http://www.w3.org/TR/2009/WD-html5-20090423/editing.html#textFieldSelection), so check that the input has selection capabilities before accessing the property.

Fixes #437.
2013-10-20 14:39:37 -07:00
Paul O’Shannessy 48281a17e4 bump version to 0.6.0-alpha 2013-10-15 22:39:28 -07:00
Paul O’Shannessy cff62f8d72 Enable linting for bitwise operators 2013-10-15 18:02:28 -07:00
Paul O'Shannessy 3f2ba221ef Use getActiveElement module
We had something that did the same sort of protection. The module
differs slightly (returns document.body instead of undefined) but
looking at the callers, that should be ok.
2013-10-15 18:00:05 -07:00
Paul O'Shannessy 46713c3d7d Fix Lint
Enabling bitwise linting caught another user. Also fixed a semicolon
misuse.
2013-10-15 17:59:14 -07:00
Paul O’Shannessy 087c2afed1 Make sure DOM components work in JSDOM 2013-10-15 11:38:26 -07:00
Paul O’Shannessy b0645bd5d3 Be consistent with object naming in tests
This also fixes line length issues our linter was complaining about.
2013-10-15 11:38:26 -07:00
SanderSpies 5a13dd090d Standardize prop -> DOM attribute process
Allow more than strings and numbers to be used as attributes for DOM
nodes. This removes the special casing for `0` and `false` that was
being used in ReactDOMInput and ReactDOMTextarea.

Now we will just `toString` any object we try to insert into a DOM.

Closes #422, #372, #302
2013-10-15 11:38:25 -07:00
Paul O'Shannessy b0455f4670 Ensure attribute values are strings
`jsdom` behavers differently than browsers here and we should ensure
that we are consistent. Browsers should be (and are) converting to
a string first, while `jsdom` doesn't.
2013-10-15 10:39:51 -07:00
Tim Yung 287f5b578c Add bitwise lint escape to DefaultDOMPropertyConfig 2013-10-15 10:38:31 -07:00
Ben Alpert 7909c3e71b Forcibly wrap SVG nodes with <svg> on creation
Forcing wrapping seems necessary here: I compared a <circle> created within a <div> with a <circle> created inside an <svg> and they appear to have exactly the same properties with the exception of .parentNode (and .parentElement), yet the former refuses to show up when appended to an <svg> element. As such, I can't find any useful way to write a unit test (testing getMarkupWrap's output doesn't seem particularly useful to me).

Fixes #311.

Test Plan:
With a component that adds a <circle> after mounting (such as http://jsfiddle.net/spicyj/hxFVe/), verify that the circle appears in both Chrome and IE9.
2013-10-14 13:44:36 -07:00
Paul O’Shannessy b45c82c256 Merge pull request #419 from piranha/svg-attrs
svg properties -> attributes

Fixes #190
2013-10-14 11:24:36 -07:00
Alexander Solovyov 3a5a82fd18 DefaultDOMPropertyConfig: sort properties alphabetically 2013-10-14 20:45:00 +03:00
Josh Duck 1238f5f23a Remove DOM mutation listeners
Mutation listeners are known to be slow. Rough benchmarks show text
changes are now 50% faster.
2013-10-11 17:33:47 -07:00
Owen Coutts ac9f5e9da4 Better click behavior for ff
Firefox created onClick events for right mouse clicks. This diff brings behavior on firefox inline with other browsers.
2013-10-11 15:42:22 -07:00
Josh Duck 58c392ae3b Check for null selection
getRangeAt(0) will throw on null selection. Add guard in
ReactDOMSelection and DocumentSelection.
2013-10-11 12:52:19 -07:00
Alexander Solovyov aa38ffc22d svg attributes properly cased when assigned by react 2013-10-11 15:48:17 +03:00
Alexander Solovyov 6d300527c8 svg: rx/ry for rounded corners 2013-10-11 13:42:10 +03:00