diff --git a/src/renderers/dom/shared/ReactBrowserEventEmitter.js b/src/renderers/dom/shared/ReactBrowserEventEmitter.js index 0d6a3b7a46db7..ee984662cb82d 100644 --- a/src/renderers/dom/shared/ReactBrowserEventEmitter.js +++ b/src/renderers/dom/shared/ReactBrowserEventEmitter.js @@ -153,7 +153,7 @@ var topEventMapping = { */ var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2); -function getListeningForDocument(mountAt) { +function getListeningForContainer(mountAt) { // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` // directly. if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { @@ -214,29 +214,12 @@ var ReactBrowserEventEmitter = Object.assign({}, ReactEventEmitterMixin, { }, /** - * We listen for bubbled touch events on the document object. - * - * Firefox v8.01 (and possibly others) exhibited strange behavior when - * mounting `onmousemove` events at some node that was not the document - * element. The symptoms were that if your mouse is not moving over something - * contained within that mount point (for example on the background) the - * top-level listeners for `onmousemove` won't be called. However, if you - * register the `mousemove` on the document object, then it will of course - * catch all `mousemove`s. This along with iOS quirks, justifies restricting - * top-level listeners to the document object only, at least for these - * movement types of events and possibly all events. - * - * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html - * - * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but - * they bubble to document. - * * @param {string} registrationName Name of listener (e.g. `onClick`). - * @param {object} contentDocumentHandle Document which owns the container + * @param {DOMElement} container element to attach the listener onto */ - listenTo: function(registrationName, contentDocumentHandle) { - var mountAt = contentDocumentHandle; - var isListening = getListeningForDocument(mountAt); + listenTo: function(registrationName, container) { + var mountAt = container; + var isListening = getListeningForContainer(mountAt); var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName]; diff --git a/src/renderers/dom/stack/client/ReactDOMComponent.js b/src/renderers/dom/stack/client/ReactDOMComponent.js index 0da6954928477..f190801063ec0 100644 --- a/src/renderers/dom/stack/client/ReactDOMComponent.js +++ b/src/renderers/dom/stack/client/ReactDOMComponent.js @@ -217,9 +217,7 @@ function enqueuePutListener(inst, registrationName, listener, transaction) { 'This browser doesn\'t support the `onScroll` event' ); } - var containerInfo = inst._hostContainerInfo; - var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; - var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument; + var doc = inst._hostContainerInfo._node; listenTo(registrationName, doc); transaction.getReactMountReady().enqueue(putListener, { inst: inst, diff --git a/vjeux-test/react-dom.js b/vjeux-test/react-dom.js new file mode 100644 index 0000000000000..7af866eae739b --- /dev/null +++ b/vjeux-test/react-dom.js @@ -0,0 +1,18304 @@ + /** + * ReactDOM v16.0.0-alpha + */ + +;(function(f) { + // CommonJS + if (typeof exports === "object" && typeof module !== "undefined") { + f(require('react')); + + // RequireJS + } else if (typeof define === "function" && define.amd) { + require(['react'], f); + + //