react-native/React/Views
Nick Lockwood 1048e5d344 Fixed removeClippedSubviews
Summary:
The `removeClippedSubviews` feature works by umounting views from the hierarchy if they move outside the bounds of their parent.

This was previously restricted to clipping views which had `overflow: hidden`, since we cannot efficiently check whether the subviews of a view go outside its bounds, and so clipping a view that has potentially overflowing children becomes an expensive recursive operation.

The problem with this is that `overflow: visible` is the default, and it's not well documented nor easy to tell that `removeClippedSubviews` has been set up correctly (i.e. with all children having `overflow: hidden`).

When I checked, I found that `removeClippedSubviews` was not working on any of the examples in UIExplorer, nor in several of our internal apps, because the views inside the ListView has `overflow: visible`. This was probably caused by an infra change at some point, but I'm not sure how long it's been broken.

It's vanishingly unlikely that anyone would ever deliberately want subviews to overflow their bounds in this scenario, so I've updated the logic to simply ignore the `overflow` property and assume that views should be clipped if you are using the `removeClippedSubviews` property on the parent.

Cons / Breaking changes: in some rare circumstances, a view might get clipped prematurely if its parent is outside the scrollview bounds, but it itself is inside. This doesn't occur in practice in any of our products, and could be worked around with additional wrapper views if it did.

Pros: removeClippedSubviews is now much easier to use, and much more likely to work as intended, so most list-based apps should see a performance improvement.

Reviewed By: javache

Differential Revision: D3385316

fbshipit-source-id: 1c0064a4c21340a971ba80d794062a356ae6cfb3
2016-06-06 07:58:35 -07:00
..
RCTActivityIndicatorViewManager.h Improved RCTActivityIndicatorView and fixed some flow errors 2015-04-26 02:17:13 -08:00
RCTActivityIndicatorViewManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTAnimationType.h [LayoutAnimation] RCTAnimationTypeKeyboard 2015-06-25 09:17:01 -08:00
RCTAutoInsetsProtocol.h Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
RCTBorderDrawing.h Support dashed and dotted border styles on iOS 2015-12-23 10:07:28 -08:00
RCTBorderDrawing.m Fixed border smearing issue 2016-01-07 12:03:17 -08:00
RCTBorderStyle.h Add property mapping for `borderStyle` from JS to `RCTView` (iOS) 2015-12-01 09:00:28 -08:00
RCTComponent.h added `didSetProps` for views and shadow views 2015-11-27 04:03:42 -08:00
RCTComponentData.h Removed eager init of all ViewManagers on layout 2016-02-26 08:18:34 -08:00
RCTComponentData.m Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RCTConvert+CoreLocation.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+CoreLocation.m [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+MapKit.h Added ability to use a custom view for MapView annotations 2015-12-17 06:46:33 -08:00
RCTConvert+MapKit.m Implement draggable annotations on MapView. Closes #2512 2016-01-04 06:38:30 -08:00
RCTDatePicker.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePicker.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePickerManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTDatePickerManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTMap.h Add MapView annotation callback when it gets / lost the focus 2016-01-29 06:26:30 -08:00
RCTMap.m Conditionally allowing showCompass view property 2016-02-03 11:36:36 -08:00
RCTMapAnnotation.h Implement draggable annotations on MapView. Closes #2512 2016-01-04 06:38:30 -08:00
RCTMapAnnotation.m Add Polyline support to MapView 2015-11-26 08:54:16 -08:00
RCTMapManager.h
RCTMapManager.m Fixed array bounds error in MapView 2016-04-22 10:59:29 -07:00
RCTMapOverlay.h Add Polyline support to MapView 2015-11-26 08:54:16 -08:00
RCTMapOverlay.m Add Polyline support to MapView 2015-11-26 08:54:16 -08:00
RCTModalHostView.h Modal Animation Types 2016-04-28 16:00:32 -07:00
RCTModalHostView.m Modal Animation Types 2016-04-28 16:00:32 -07:00
RCTModalHostViewController.h Add <Modal /> component 2015-07-28 07:21:50 -08:00
RCTModalHostViewController.m Support multiple interface orientations in RCTDevLoadingView 2016-02-25 09:52:30 -08:00
RCTModalHostViewManager.h Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTModalHostViewManager.m Modal Animation Types 2016-04-28 16:00:32 -07:00
RCTNavItem.h Added RCTImageSource 2015-12-08 03:32:30 -08:00
RCTNavItem.m Added RCTImageSource 2015-12-08 03:32:30 -08:00
RCTNavItemManager.h
RCTNavItemManager.m Added RCTImageSource 2015-12-08 03:32:30 -08:00
RCTNavigator.h NavigatorIOS: Expose interactivePopGestureEnabled property 2016-05-06 03:18:20 -07:00
RCTNavigator.m NavigatorIOS: Expose interactivePopGestureEnabled property 2016-05-06 03:18:20 -07:00
RCTNavigatorManager.h
RCTNavigatorManager.m NavigatorIOS: Expose interactivePopGestureEnabled property 2016-05-06 03:18:20 -07:00
RCTPicker.h Added support for styling the PickerIOS 2015-12-08 07:48:26 -08:00
RCTPicker.m Added support for styling the PickerIOS 2015-12-08 07:48:26 -08:00
RCTPickerManager.h
RCTPickerManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTPointerEvents.h
RCTProgressViewManager.h Added ProgressViewIOS 2015-06-03 09:49:35 -08:00
RCTProgressViewManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTRefreshControl.h Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
RCTRefreshControl.m RefreshControl on initial render will not beginRefresh when refreshing state is false 2016-05-13 14:43:26 -07:00
RCTRefreshControlManager.h Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
RCTRefreshControlManager.m Allow to set refresh control title color 2016-04-16 15:15:25 -07:00
RCTRootShadowView.h Extracted rootview-specific shadowview logic into new class 2016-03-21 03:21:27 -07:00
RCTRootShadowView.m import css-layout-185 2016-05-31 04:13:32 -07:00
RCTScrollView.h Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing 2016-05-24 03:28:25 -07:00
RCTScrollView.m Fixed bug where layoutSubviews was called continuously for scrollview 2016-06-06 05:28:31 -07:00
RCTScrollViewManager.h Remove scrollview support from UIManager, remove mainScrollView(delegate) 2015-11-25 04:12:34 -08:00
RCTScrollViewManager.m Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing 2016-05-24 03:28:25 -07:00
RCTScrollableProtocol.h Add an array of scrollviewlisteners in RCTScrollableProtocol 2016-05-12 12:17:20 -07:00
RCTSegmentedControl.h Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
RCTSegmentedControl.m Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
RCTSegmentedControlManager.h Add SegmentedControlIOS 2015-04-29 08:08:45 -08:00
RCTSegmentedControlManager.m Removed exported constants for fixed-size views 2016-04-26 04:21:39 -07:00
RCTShadowView.h iOS: Enable views to be nested within <Text> 2016-05-31 10:28:25 -07:00
RCTShadowView.m iOS: Enable views to be nested within <Text> 2016-05-31 10:28:25 -07:00
RCTSlider.h Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
RCTSlider.m Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
RCTSliderManager.h
RCTSliderManager.m Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
RCTSwitch.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSwitch.m
RCTSwitchManager.h
RCTSwitchManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBar.h Enable setting color of text and images on unselected tabs 2016-05-03 05:40:29 -07:00
RCTTabBar.m TabBarIOS itemPositioning - Fixes #4136 2016-05-20 17:28:50 -07:00
RCTTabBarItem.h Add renderAsOriginal to selectedIcon 2016-05-24 01:58:23 -07:00
RCTTabBarItem.m Add renderAsOriginal to selectedIcon 2016-05-24 01:58:23 -07:00
RCTTabBarItemManager.h
RCTTabBarItemManager.m Add renderAsOriginal to selectedIcon 2016-05-24 01:58:23 -07:00
RCTTabBarManager.h
RCTTabBarManager.m TabBarIOS itemPositioning - Fixes #4136 2016-05-20 17:28:50 -07:00
RCTTextDecorationLineType.h <Text> module add textDecoration style attributes 2015-07-07 06:15:20 -08:00
RCTView.h Add hitSlop prop on iOS and Android 2016-02-16 16:51:39 -08:00
RCTView.m Fixed removeClippedSubviews 2016-06-06 07:58:35 -07:00
RCTViewControllerProtocol.h
RCTViewManager.h Move setBridge: off main thread 2016-05-03 09:09:21 -07:00
RCTViewManager.m Expose UIManager queue via a static function to prevent race conditions 2016-05-16 08:13:21 -07:00
RCTWebView.h Implemented stopLoading 2016-04-22 08:15:25 -07:00
RCTWebView.m Implemented stopLoading 2016-04-22 08:15:25 -07:00
RCTWebViewManager.h
RCTWebViewManager.m Implemented stopLoading 2016-04-22 08:15:25 -07:00
RCTWrapperViewController.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWrapperViewController.m Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
UIView+Private.h Perform clip update on RCTScrollView in increments of 50 pt 2015-08-13 07:56:41 -08:00
UIView+React.h Add debug tool to get shadowView from UIView 2016-03-16 10:18:22 -07:00
UIView+React.m Fix arc focus build 2016-03-22 10:58:29 -07:00