Remove scroll capture support warning (#9303)
I removed the scroll capture feature check for IE8, however I missed the associated warning.
Nathan Hunzaker committed
Mar 31, 2017 at 06:36 UTC
27c844905fcbb64ca0ba7c0a6b0fa0e121f9c429
5 files changed
-44
scripts/fiber/tests-passing-except-dev.txt
-1
@@ -1,5 +1,4 @@
1
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
2
-* should not warn when server-side rendering `onScroll`
2
* should warn about incorrect casing on properties (ssr)
3
* should warn about incorrect casing on event handlers (ssr)
4
* should warn about class (ssr)
scripts/fiber/tests-passing.txt
-1
@@ -951,7 +951,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
951
* should report component containing invalid styles
952
* should properly escape text content and attributes values
953
* unmounts children before unsetting DOM node info
954
-* should warn about the `onScroll` issue when unsupported (IE8)
954
* should throw when an invalid tag name is used server-side
955
* should throw when an attack vector is used server-side
956
* should throw when an invalid tag name is used
src/renderers/dom/fiber/ReactDOMFiberComponent.js
-9
@@ -28,7 +28,6 @@ var {getCurrentFiberOwnerName} = require('ReactDebugCurrentFiber');
28
29
var emptyFunction = require('fbjs/lib/emptyFunction');
30
var invariant = require('fbjs/lib/invariant');
31
-var isEventSupported = require('isEventSupported');
31
var setInnerHTML = require('setInnerHTML');
32
var setTextContent = require('setTextContent');
33
var inputValueTracking = require('inputValueTracking');
@@ -145,14 +144,6 @@ if (__DEV__) {
144
}
145
146
function ensureListeningTo(rootContainerElement, registrationName) {
148
- if (__DEV__) {
149
- // IE8 has no API for event capturing and the `onScroll` event doesn't
150
- // bubble.
151
- warning(
152
- registrationName !== 'onScroll' || isEventSupported('scroll', true),
153
- "This browser doesn't support the `onScroll` event",
154
- );
155
- }
147
var isDocumentFragment = rootContainerElement.nodeType === DOC_FRAGMENT_TYPE;
148
var doc = isDocumentFragment
149
? rootContainerElement
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
-24
@@ -1233,30 +1233,6 @@ describe('ReactDOMComponent', () => {
1233
});
1234
});
1235
1236
- describe('onScroll warning', () => {
1237
- it('should warn about the `onScroll` issue when unsupported (IE8)', () => {
1238
- // Mock this here so we can mimic IE8 support. We require isEventSupported
1239
- // before React so it's pre-mocked before React would require it.
1240
- jest.resetModules().mock('isEventSupported');
1241
- var isEventSupported = require('isEventSupported');
1242
- isEventSupported.mockReturnValueOnce(false);
1243
- ReactTestUtils = require('ReactTestUtils');
1244
-
1245
- spyOn(console, 'error');
1246
- ReactTestUtils.renderIntoDocument(<div onScroll={function() {}} />);
1247
- expectDev(console.error.calls.count()).toBe(1);
1248
- expectDev(console.error.calls.argsFor(0)[0]).toBe(
1249
- "Warning: This browser doesn't support the `onScroll` event",
1250
- );
1251
- });
1252
-
1253
- it('should not warn when server-side rendering `onScroll`', () => {
1254
- spyOn(console, 'error');
1255
- ReactDOMServer.renderToString(<div onScroll={() => {}} />);
1256
- expectDev(console.error).not.toHaveBeenCalled();
1257
- });
1258
- });
1259
-
1236
describe('tag sanitization', () => {
1237
it('should throw when an invalid tag name is used server-side', () => {
1238
var hackzor = React.createElement('script tag');
src/renderers/dom/stack/client/ReactDOMComponent.js
-9
@@ -34,7 +34,6 @@ var ReactServerRenderingTransaction = require('ReactServerRenderingTransaction')
34
var emptyFunction = require('fbjs/lib/emptyFunction');
35
var escapeTextContentForBrowser = require('escapeTextContentForBrowser');
36
var invariant = require('fbjs/lib/invariant');
37
-var isEventSupported = require('isEventSupported');
37
var inputValueTracking = require('inputValueTracking');
38
var validateDOMNesting = require('validateDOMNesting');
39
var warning = require('fbjs/lib/warning');
@@ -138,14 +137,6 @@ function ensureListeningTo(inst, registrationName, transaction) {
137
if (transaction instanceof ReactServerRenderingTransaction) {
138
return;
139
}
141
- if (__DEV__) {
142
- // IE8 has no API for event capturing and the `onScroll` event doesn't
143
- // bubble.
144
- warning(
145
- registrationName !== 'onScroll' || isEventSupported('scroll', true),
146
- "This browser doesn't support the `onScroll` event",
147
- );
148
- }
140
var containerInfo = inst._hostContainerInfo;
141
var isDocumentFragment = containerInfo._node &&
142
containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;