From 65cb12fb72731142f9feceb02ae4a07ba2718e53 Mon Sep 17 00:00:00 2001 From: Xin Chen Date: Tue, 7 Feb 2023 09:22:58 -0800 Subject: [PATCH] Remove useOverflowInset flag as we rolled out 100% to public for over three months Summary: This was shipped in D36990986 (https://github.com/facebook/react-native/commit/df80ed40c7cde6cf81a0974d78ef0a7cfcf19e5c) but backed out last year in D37074879 (https://github.com/facebook/react-native/commit/59476d06f3be2e1c764c21447b4cf2ea712dd172), as we want to wait for some performance comparison results to come out. Remove overflow inset optimization flags as they've been rolled out 100% to public. Changelog: [Android][Internal] - Clean up feature flags for overflowInset Reviewed By: javache Differential Revision: D43070494 fbshipit-source-id: dbf5aed9b2b5d3db1ad351bc208cb2016dc62e40 --- .../com/facebook/react/config/ReactFeatureFlags.java | 3 --- .../com/facebook/react/uimanager/TouchTargetHelper.java | 2 -- .../src/main/jni/react/fabric/FabricMountingManager.cpp | 9 +++------ .../src/main/jni/react/fabric/FabricMountingManager.h | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index 44dbc60da5b8c6..a4df8b3565d6a9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -67,9 +67,6 @@ public class ReactFeatureFlags { /** Enables or disables calculation of Transformed Frames */ public static boolean calculateTransformedFramesEnabled = false; - /** Feature Flag to use overflowInset values provided by Yoga */ - public static boolean useOverflowInset = false; - public static boolean dispatchPointerEvents = false; /** Feature Flag to enable the pending event queue in fabric before mounting views */ diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java index 4b1a518f10dd7b..cff46d4dcbd27e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java @@ -19,7 +19,6 @@ import androidx.annotation.Nullable; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; import com.facebook.react.bridge.UiThreadUtil; -import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.touch.ReactHitSlopView; import com.facebook.react.uimanager.common.ViewUtil; import java.util.ArrayList; @@ -192,7 +191,6 @@ private static View findTouchTargetView( // If the touch point is outside of the overflowinset for the view, we can safely ignore // it. if (ViewUtil.getUIManagerType(view.getId()) == FABRIC - && ReactFeatureFlags.useOverflowInset && !isTouchPointInViewWithOverflowInset(eventCoords[0], eventCoords[1], view)) { return null; } diff --git a/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp b/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp index b1097967515bfd..345523cf54be56 100644 --- a/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +++ b/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp @@ -40,7 +40,6 @@ FabricMountingManager::FabricMountingManager( std::shared_ptr &config, global_ref &javaUIManager) : javaUIManager_(javaUIManager), - useOverflowInset_(getFeatureFlagValue("useOverflowInset")), reduceDeleteCreateMutation_( getFeatureFlagValue("reduceDeleteCreateMutation")) { CoreFeatures::enableMapBuffer = getFeatureFlagValue("useMapBufferProps"); @@ -404,8 +403,7 @@ void FabricMountingManager::executeMount( // children of the current view. The layout of current view may not // change, and we separate this part from layout mount items to not // pack too much data there. - if (useOverflowInset_ && - (oldChildShadowView.layoutMetrics.overflowInset != + if ((oldChildShadowView.layoutMetrics.overflowInset != newChildShadowView.layoutMetrics.overflowInset)) { cppUpdateOverflowInsetMountItems.push_back( CppMountItem::UpdateOverflowInsetMountItem( @@ -461,9 +459,8 @@ void FabricMountingManager::executeMount( // children of the current view. The layout of current view may not // change, and we separate this part from layout mount items to not // pack too much data there. - if (useOverflowInset_ && - newChildShadowView.layoutMetrics.overflowInset != - EdgeInsets::ZERO) { + if (newChildShadowView.layoutMetrics.overflowInset != + EdgeInsets::ZERO) { cppUpdateOverflowInsetMountItems.push_back( CppMountItem::UpdateOverflowInsetMountItem( newChildShadowView)); diff --git a/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h b/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h index 37440bf50198b0..c098e661b66632 100644 --- a/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h +++ b/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h @@ -69,7 +69,6 @@ class FabricMountingManager final { butter::map> allocatedViewRegistry_{}; std::recursive_mutex allocatedViewsMutex_; - bool const useOverflowInset_{false}; bool const reduceDeleteCreateMutation_{false}; jni::local_ref getProps(