mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove scroll capture support warning (#9303)
I removed the scroll capture feature check for IE8, however I missed the associated warning.
This commit is contained in:
committed by
Dan Abramov
parent
bd2802523c
commit
27c844905f
@@ -1,5 +1,4 @@
|
||||
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
|
||||
* should not warn when server-side rendering `onScroll`
|
||||
* should warn about incorrect casing on properties (ssr)
|
||||
* should warn about incorrect casing on event handlers (ssr)
|
||||
* should warn about class (ssr)
|
||||
|
||||
@@ -951,7 +951,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
|
||||
* should report component containing invalid styles
|
||||
* should properly escape text content and attributes values
|
||||
* unmounts children before unsetting DOM node info
|
||||
* should warn about the `onScroll` issue when unsupported (IE8)
|
||||
* should throw when an invalid tag name is used server-side
|
||||
* should throw when an attack vector is used server-side
|
||||
* should throw when an invalid tag name is used
|
||||
|
||||
@@ -28,7 +28,6 @@ var {getCurrentFiberOwnerName} = require('ReactDebugCurrentFiber');
|
||||
|
||||
var emptyFunction = require('fbjs/lib/emptyFunction');
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
var isEventSupported = require('isEventSupported');
|
||||
var setInnerHTML = require('setInnerHTML');
|
||||
var setTextContent = require('setTextContent');
|
||||
var inputValueTracking = require('inputValueTracking');
|
||||
@@ -145,14 +144,6 @@ if (__DEV__) {
|
||||
}
|
||||
|
||||
function ensureListeningTo(rootContainerElement, registrationName) {
|
||||
if (__DEV__) {
|
||||
// IE8 has no API for event capturing and the `onScroll` event doesn't
|
||||
// bubble.
|
||||
warning(
|
||||
registrationName !== 'onScroll' || isEventSupported('scroll', true),
|
||||
"This browser doesn't support the `onScroll` event",
|
||||
);
|
||||
}
|
||||
var isDocumentFragment = rootContainerElement.nodeType === DOC_FRAGMENT_TYPE;
|
||||
var doc = isDocumentFragment
|
||||
? rootContainerElement
|
||||
|
||||
@@ -1233,30 +1233,6 @@ describe('ReactDOMComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('onScroll warning', () => {
|
||||
it('should warn about the `onScroll` issue when unsupported (IE8)', () => {
|
||||
// Mock this here so we can mimic IE8 support. We require isEventSupported
|
||||
// before React so it's pre-mocked before React would require it.
|
||||
jest.resetModules().mock('isEventSupported');
|
||||
var isEventSupported = require('isEventSupported');
|
||||
isEventSupported.mockReturnValueOnce(false);
|
||||
ReactTestUtils = require('ReactTestUtils');
|
||||
|
||||
spyOn(console, 'error');
|
||||
ReactTestUtils.renderIntoDocument(<div onScroll={function() {}} />);
|
||||
expectDev(console.error.calls.count()).toBe(1);
|
||||
expectDev(console.error.calls.argsFor(0)[0]).toBe(
|
||||
"Warning: This browser doesn't support the `onScroll` event",
|
||||
);
|
||||
});
|
||||
|
||||
it('should not warn when server-side rendering `onScroll`', () => {
|
||||
spyOn(console, 'error');
|
||||
ReactDOMServer.renderToString(<div onScroll={() => {}} />);
|
||||
expectDev(console.error).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('tag sanitization', () => {
|
||||
it('should throw when an invalid tag name is used server-side', () => {
|
||||
var hackzor = React.createElement('script tag');
|
||||
|
||||
@@ -34,7 +34,6 @@ var ReactServerRenderingTransaction = require('ReactServerRenderingTransaction')
|
||||
var emptyFunction = require('fbjs/lib/emptyFunction');
|
||||
var escapeTextContentForBrowser = require('escapeTextContentForBrowser');
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
var isEventSupported = require('isEventSupported');
|
||||
var inputValueTracking = require('inputValueTracking');
|
||||
var validateDOMNesting = require('validateDOMNesting');
|
||||
var warning = require('fbjs/lib/warning');
|
||||
@@ -138,14 +137,6 @@ function ensureListeningTo(inst, registrationName, transaction) {
|
||||
if (transaction instanceof ReactServerRenderingTransaction) {
|
||||
return;
|
||||
}
|
||||
if (__DEV__) {
|
||||
// IE8 has no API for event capturing and the `onScroll` event doesn't
|
||||
// bubble.
|
||||
warning(
|
||||
registrationName !== 'onScroll' || isEventSupported('scroll', true),
|
||||
"This browser doesn't support the `onScroll` event",
|
||||
);
|
||||
}
|
||||
var containerInfo = inst._hostContainerInfo;
|
||||
var isDocumentFragment = containerInfo._node &&
|
||||
containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
|
||||
|
||||
Reference in New Issue
Block a user