Skip to content

Commit 344ac2a

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Remove syncAndroidClipToPaddingWithOverflow feature flag
Summary: Remove the `syncAndroidClipToPaddingWithOverflow` feature flag and all associated logic. This flag synced Android `clipToPadding` with the CSS `overflow` property, but `clipToPadding` has no effect when padding is 0 (the default for most RN views), making the entire mechanism insufficient. We will replace this with `setClipBounds()` in a follow-up diff (T253147322). - Remove clipToPadding logic from `ReactViewGroup.initView()` and `overflow` setter - Remove `getClipToPadding()` overrides from ReactScrollView, ReactHorizontalScrollView - Regenerate ReactNestedScrollView from updated ReactScrollView source - Remove hardcoded override from ReactNativeFeatureFlagsOverrides_PanelApp - Remove flag definition from ReactNativeFeatureFlags.config.js and regenerate all feature flag infrastructure files Reviewed By: zeyap Differential Revision: D101153619
1 parent a6f2697 commit 344ac2a

24 files changed

Lines changed: 37 additions & 183 deletions

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<99a7d3e814f4b037ed4496b6eee4f264>>
7+
* @generated SignedSource<<3632d7131c67082fcab2730372d7b844>>
88
*/
99

1010
/**
@@ -462,12 +462,6 @@ public object ReactNativeFeatureFlags {
462462
@JvmStatic
463463
public fun skipActivityIdentityAssertionOnHostPause(): Boolean = accessor.skipActivityIdentityAssertionOnHostPause()
464464

465-
/**
466-
* Sync clipToPadding on Android views with the overflow property
467-
*/
468-
@JvmStatic
469-
public fun syncAndroidClipToPaddingWithOverflow(): Boolean = accessor.syncAndroidClipToPaddingWithOverflow()
470-
471465
/**
472466
* Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
473467
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<c2f867597d97dc97c8ded5fbd258c13c>>
7+
* @generated SignedSource<<e8645690e6f641c4ba3a12e8ffdb8c6b>>
88
*/
99

1010
/**
@@ -92,7 +92,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
9292
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
9393
private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
9494
private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
95-
private var syncAndroidClipToPaddingWithOverflowCache: Boolean? = null
9695
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
9796
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
9897
private var updateRuntimeShadowNodeReferencesOnCommitThreadCache: Boolean? = null
@@ -758,15 +757,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
758757
return cached
759758
}
760759

761-
override fun syncAndroidClipToPaddingWithOverflow(): Boolean {
762-
var cached = syncAndroidClipToPaddingWithOverflowCache
763-
if (cached == null) {
764-
cached = ReactNativeFeatureFlagsCxxInterop.syncAndroidClipToPaddingWithOverflow()
765-
syncAndroidClipToPaddingWithOverflowCache = cached
766-
}
767-
return cached
768-
}
769-
770760
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
771761
var cached = traceTurboModulePromiseRejectionsOnAndroidCache
772762
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<8667d7237cea82bb5978cb19582d59c0>>
7+
* @generated SignedSource<<352dd8f7650ed909e0849d884fde2a1a>>
88
*/
99

1010
/**
@@ -172,8 +172,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
172172

173173
@DoNotStrip @JvmStatic public external fun skipActivityIdentityAssertionOnHostPause(): Boolean
174174

175-
@DoNotStrip @JvmStatic public external fun syncAndroidClipToPaddingWithOverflow(): Boolean
176-
177175
@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
178176

179177
@DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<17abc72a4045c5695818f254be1783b5>>
7+
* @generated SignedSource<<5c3cdc141c1215f860e42e80a648b69c>>
88
*/
99

1010
/**
@@ -167,8 +167,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
167167

168168
override fun skipActivityIdentityAssertionOnHostPause(): Boolean = false
169169

170-
override fun syncAndroidClipToPaddingWithOverflow(): Boolean = false
171-
172170
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
173171

174172
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = false

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<77ba6c5db120016e6e1f8af195ab3690>>
7+
* @generated SignedSource<<27d52945e56c76f8f5712e645b1e24be>>
88
*/
99

1010
/**
@@ -96,7 +96,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
9696
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
9797
private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
9898
private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
99-
private var syncAndroidClipToPaddingWithOverflowCache: Boolean? = null
10099
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
101100
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
102101
private var updateRuntimeShadowNodeReferencesOnCommitThreadCache: Boolean? = null
@@ -834,16 +833,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
834833
return cached
835834
}
836835

837-
override fun syncAndroidClipToPaddingWithOverflow(): Boolean {
838-
var cached = syncAndroidClipToPaddingWithOverflowCache
839-
if (cached == null) {
840-
cached = currentProvider.syncAndroidClipToPaddingWithOverflow()
841-
accessedFeatureFlags.add("syncAndroidClipToPaddingWithOverflow")
842-
syncAndroidClipToPaddingWithOverflowCache = cached
843-
}
844-
return cached
845-
}
846-
847836
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
848837
var cached = traceTurboModulePromiseRejectionsOnAndroidCache
849838
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<8496c138ce5493df84149940df0de944>>
7+
* @generated SignedSource<<7db5b636041b77e17d83f3ada8a1a6b5>>
88
*/
99

1010
/**
@@ -167,8 +167,6 @@ public interface ReactNativeFeatureFlagsProvider {
167167

168168
@DoNotStrip public fun skipActivityIdentityAssertionOnHostPause(): Boolean
169169

170-
@DoNotStrip public fun syncAndroidClipToPaddingWithOverflow(): Boolean
171-
172170
@DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
173171

174172
@DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,6 @@ public Rect getOverflowInset() {
461461
return mOverflowInset;
462462
}
463463

464-
@Override
465-
public boolean getClipToPadding() {
466-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
467-
return mOverflow != Overflow.VISIBLE;
468-
}
469-
return super.getClipToPadding();
470-
}
471-
472464
@Override
473465
public void onDraw(Canvas canvas) {
474466
if (mOverflow != Overflow.VISIBLE) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<dd8221f4b150b4b3bec3dafd4b745482>>
7+
* @generated SignedSource<<df77adbd3b807cf8594abc241b1d0874>>
88
*/
99

1010
/**
@@ -788,14 +788,6 @@ public void updateClippingRect(@Nullable Set<Integer> excludedViewsSet) {
788788
}
789789
}
790790

791-
@Override
792-
public boolean getClipToPadding() {
793-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
794-
return mOverflow != Overflow.VISIBLE;
795-
}
796-
return super.getClipToPadding();
797-
}
798-
799791
@Override
800792
public void getClippingRect(Rect outClippingRect) {
801793
outClippingRect.set(Assertions.assertNotNull(mClippingRect));

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,14 +780,6 @@ public void updateClippingRect(@Nullable Set<Integer> excludedViewsSet) {
780780
}
781781
}
782782

783-
@Override
784-
public boolean getClipToPadding() {
785-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
786-
return mOverflow != Overflow.VISIBLE;
787-
}
788-
return super.getClipToPadding();
789-
}
790-
791783
@Override
792784
public void getClippingRect(Rect outClippingRect) {
793785
outClippingRect.set(Assertions.assertNotNull(mClippingRect));

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ public open class ReactViewGroup public constructor(context: Context?) :
166166
*/
167167
private fun initView() {
168168
clipChildren = false
169-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
170-
clipToPadding = false
171-
}
172169

173170
_removeClippedSubviews = false
174171
inSubviewClippingLoop = false
@@ -822,9 +819,6 @@ public open class ReactViewGroup public constructor(context: Context?) :
822819
} else {
823820
Overflow.fromString(overflow)
824821
}
825-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
826-
clipToPadding = _overflow != Overflow.VISIBLE
827-
}
828822
invalidate()
829823
}
830824

0 commit comments

Comments
 (0)