Skip to content

Commit b1e1d87

Browse files
fabriziocuccifacebook-github-bot
authored andcommitted
Remove syncAndroidClipToPaddingWithOverflow feature flag (#56467)
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 Changelog: [Internal] Reviewed By: zeyap Differential Revision: D101153619
1 parent 53e6ce2 commit b1e1d87

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<<82da59cbfb06937bba284ff1df2c64d6>>
7+
* @generated SignedSource<<eb70fd41bc36f1a49849e29bea081007>>
88
*/
99

1010
/**
@@ -480,12 +480,6 @@ public object ReactNativeFeatureFlags {
480480
@JvmStatic
481481
public fun skipActivityIdentityAssertionOnHostPause(): Boolean = accessor.skipActivityIdentityAssertionOnHostPause()
482482

483-
/**
484-
* Sync clipToPadding on Android views with the overflow property
485-
*/
486-
@JvmStatic
487-
public fun syncAndroidClipToPaddingWithOverflow(): Boolean = accessor.syncAndroidClipToPaddingWithOverflow()
488-
489483
/**
490484
* Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
491485
*/

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<<b6d6b8aae3449760d857e5dd52588b03>>
7+
* @generated SignedSource<<f79ca61a0da053a1661eca4d3a35b081>>
88
*/
99

1010
/**
@@ -95,7 +95,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
9595
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
9696
private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
9797
private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
98-
private var syncAndroidClipToPaddingWithOverflowCache: Boolean? = null
9998
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
10099
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
101100
private var updateRuntimeShadowNodeReferencesOnCommitThreadCache: Boolean? = null
@@ -788,15 +787,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
788787
return cached
789788
}
790789

791-
override fun syncAndroidClipToPaddingWithOverflow(): Boolean {
792-
var cached = syncAndroidClipToPaddingWithOverflowCache
793-
if (cached == null) {
794-
cached = ReactNativeFeatureFlagsCxxInterop.syncAndroidClipToPaddingWithOverflow()
795-
syncAndroidClipToPaddingWithOverflowCache = cached
796-
}
797-
return cached
798-
}
799-
800790
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
801791
var cached = traceTurboModulePromiseRejectionsOnAndroidCache
802792
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<<7ca56a7b519e6e1619931447dcc1672a>>
7+
* @generated SignedSource<<62d1f0fcdf8e3165480da12575d62826>>
88
*/
99

1010
/**
@@ -178,8 +178,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
178178

179179
@DoNotStrip @JvmStatic public external fun skipActivityIdentityAssertionOnHostPause(): Boolean
180180

181-
@DoNotStrip @JvmStatic public external fun syncAndroidClipToPaddingWithOverflow(): Boolean
182-
183181
@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
184182

185183
@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<<fe424de3f03b5f2ee20b83896eef01b1>>
7+
* @generated SignedSource<<84ac5b80585f9185c879c81822718d86>>
88
*/
99

1010
/**
@@ -173,8 +173,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
173173

174174
override fun skipActivityIdentityAssertionOnHostPause(): Boolean = false
175175

176-
override fun syncAndroidClipToPaddingWithOverflow(): Boolean = false
177-
178176
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
179177

180178
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<<0de759cf10c9d77c9938f9dac257aada>>
7+
* @generated SignedSource<<3574e23fe8f846e408964af26cf0dd4c>>
88
*/
99

1010
/**
@@ -99,7 +99,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
9999
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
100100
private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
101101
private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
102-
private var syncAndroidClipToPaddingWithOverflowCache: Boolean? = null
103102
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
104103
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
105104
private var updateRuntimeShadowNodeReferencesOnCommitThreadCache: Boolean? = null
@@ -867,16 +866,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
867866
return cached
868867
}
869868

870-
override fun syncAndroidClipToPaddingWithOverflow(): Boolean {
871-
var cached = syncAndroidClipToPaddingWithOverflowCache
872-
if (cached == null) {
873-
cached = currentProvider.syncAndroidClipToPaddingWithOverflow()
874-
accessedFeatureFlags.add("syncAndroidClipToPaddingWithOverflow")
875-
syncAndroidClipToPaddingWithOverflowCache = cached
876-
}
877-
return cached
878-
}
879-
880869
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
881870
var cached = traceTurboModulePromiseRejectionsOnAndroidCache
882871
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<<dd7ae1c5f86fa273402e5b64a8636528>>
7+
* @generated SignedSource<<9222fd90d191a91893e2c58770d83259>>
88
*/
99

1010
/**
@@ -173,8 +173,6 @@ public interface ReactNativeFeatureFlagsProvider {
173173

174174
@DoNotStrip public fun skipActivityIdentityAssertionOnHostPause(): Boolean
175175

176-
@DoNotStrip public fun syncAndroidClipToPaddingWithOverflow(): Boolean
177-
178176
@DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
179177

180178
@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<<74209bb4a44619a1ce16d68cfeeb0653>>
7+
* @generated SignedSource<<a0490be2c6f7eb42376e8e64abf9ce5e>>
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
@@ -164,9 +164,6 @@ public open class ReactViewGroup public constructor(context: Context?) :
164164
*/
165165
private fun initView() {
166166
clipChildren = false
167-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
168-
clipToPadding = false
169-
}
170167

171168
_removeClippedSubviews = false
172169
inSubviewClippingLoop = false
@@ -820,9 +817,6 @@ public open class ReactViewGroup public constructor(context: Context?) :
820817
} else {
821818
Overflow.fromString(overflow)
822819
}
823-
if (ReactNativeFeatureFlags.syncAndroidClipToPaddingWithOverflow()) {
824-
clipToPadding = _overflow != Overflow.VISIBLE
825-
}
826820
invalidate()
827821
}
828822

0 commit comments

Comments
 (0)