Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/react-native/Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type {
import type {NativeTextProps} from './TextNativeComponent';
import type {PressRetentionOffset, TextProps} from './TextProps';

import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
import {getNativeElementReference} from '../../src/private/webapis/dom/nodes/internals/NodeInternals';
import NativeDOM from '../../src/private/webapis/dom/nodes/specs/NativeDOM';
import * as PressabilityDebug from '../Pressability/PressabilityDebug';
Expand Down Expand Up @@ -241,9 +240,7 @@ const TextImpl: component(
}
}

if (ReactNativeFeatureFlags.defaultTextToOverflowHidden()) {
_style = [styles.default, _style];
}
_style = [styles.default, _style];

const _nativeID = id ?? nativeID;

Expand Down
14 changes: 14 additions & 0 deletions packages/react-native/Libraries/Text/__tests__/Text-itest.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ describe('<Text>', () => {
});
});

describe('overflow', () => {
it('preserves an explicit visible overflow style', () => {
const root = Fantom.createRoot();

Fantom.runTask(() => {
root.render(<Text style={{overflow: 'visible'}}>{TEST_TEXT}</Text>);
});

expect(root.getRenderedOutput({props: ['overflow']}).toJSX()).toEqual(
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
);
});
});

describe('fontVariationSettings', () => {
it('serializes object settings', () => {
const root = Fantom.createRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private constructor(

private fun readDataType(bucketIndex: Int): MapBuffer.DataType {
val value = readUnsignedShort(getKeyOffsetForBucketIndex(bucketIndex) + TYPE_OFFSET).toInt()
return if (ReactNativeFeatureFlags.enableAndroidTextMeasurementOptimizations()) {
return if (ReactNativeFeatureFlags.enablePreparedTextLayout()) {
DATA_TYPES[value]
} else {
MapBuffer.DataType.values()[value]
Expand Down Expand Up @@ -296,7 +296,7 @@ private constructor(

override val type: MapBuffer.DataType
get() =
if (ReactNativeFeatureFlags.enableAndroidTextMeasurementOptimizations()) {
if (ReactNativeFeatureFlags.enablePreparedTextLayout()) {
DATA_TYPES[readUnsignedShort(bucketOffset + TYPE_OFFSET).toInt()]
} else {
MapBuffer.DataType.values()[readUnsignedShort(bucketOffset + TYPE_OFFSET).toInt()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<3a6a61e2cc2bf01a35ab5c3919462ad5>>
* @generated SignedSource<<e1028cf3c77b852fa8a0f0b83efc3fc8>>
*/

/**
Expand Down Expand Up @@ -48,12 +48,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun cxxNativeAnimatedEnabled(): Boolean = accessor.cxxNativeAnimatedEnabled()

/**
* When enabled, sets the default overflow style for Text components to hidden instead of visible.
*/
@JvmStatic
public fun defaultTextToOverflowHidden(): Boolean = accessor.defaultTextToOverflowHidden()

/**
* When enabled, iOS TextInput applies edits that JS transforms (e.g. maxLength truncation) incrementally after the UIKit text change delegate call returns, avoiding synchronous text and selection rewrites that can deadlock UIKeyboardTaskQueue.
*/
Expand Down Expand Up @@ -120,12 +114,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableAliasedTextRoleInheritance(): Boolean = accessor.enableAliasedTextRoleInheritance()

/**
* Enables various optimizations throughout the path of measuring text on Android.
*/
@JvmStatic
public fun enableAndroidTextMeasurementOptimizations(): Boolean = accessor.enableAndroidTextMeasurementOptimizations()

/**
* Runs multi-source image disk-cache checks asynchronously on Android.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<fe927f4acf804e05b74dbe606e39746f>>
* @generated SignedSource<<4dd3a77d2f30112f4303fdbd336dd666>>
*/

/**
Expand All @@ -23,7 +23,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var commonTestFlagCache: Boolean? = null
private var cdpInteractionMetricsEnabledCache: Boolean? = null
private var cxxNativeAnimatedEnabledCache: Boolean? = null
private var defaultTextToOverflowHiddenCache: Boolean? = null
private var deferTextInputTruncationIOSCache: Boolean? = null
private var disableEarlyViewCommandExecutionCache: Boolean? = null
private var disableIdleEventDispatchFrameCallbackRearmAndroidCache: Boolean? = null
Expand All @@ -35,7 +34,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableAccessibilityOrderCache: Boolean? = null
private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
private var enableAliasedTextRoleInheritanceCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableAsyncDiskCacheCheckInMultiSourceImageAndroidCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
Expand Down Expand Up @@ -152,15 +150,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun defaultTextToOverflowHidden(): Boolean {
var cached = defaultTextToOverflowHiddenCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.defaultTextToOverflowHidden()
defaultTextToOverflowHiddenCache = cached
}
return cached
}

override fun deferTextInputTruncationIOS(): Boolean {
var cached = deferTextInputTruncationIOSCache
if (cached == null) {
Expand Down Expand Up @@ -260,15 +249,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun enableAndroidTextMeasurementOptimizations(): Boolean {
var cached = enableAndroidTextMeasurementOptimizationsCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableAndroidTextMeasurementOptimizations()
enableAndroidTextMeasurementOptimizationsCache = cached
}
return cached
}

override fun enableAsyncDiskCacheCheckInMultiSourceImageAndroid(): Boolean {
var cached = enableAsyncDiskCacheCheckInMultiSourceImageAndroidCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<b58702a0f594f409c0d20fd497395fde>>
* @generated SignedSource<<0199be28052914cfb09d0e90d86f20eb>>
*/

/**
Expand Down Expand Up @@ -34,8 +34,6 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun cxxNativeAnimatedEnabled(): Boolean

@DoNotStrip @JvmStatic public external fun defaultTextToOverflowHidden(): Boolean

@DoNotStrip @JvmStatic public external fun deferTextInputTruncationIOS(): Boolean

@DoNotStrip @JvmStatic public external fun disableEarlyViewCommandExecution(): Boolean
Expand All @@ -58,8 +56,6 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun enableAliasedTextRoleInheritance(): Boolean

@DoNotStrip @JvmStatic public external fun enableAndroidTextMeasurementOptimizations(): Boolean

@DoNotStrip @JvmStatic public external fun enableAsyncDiskCacheCheckInMultiSourceImageAndroid(): Boolean

@DoNotStrip @JvmStatic public external fun enableBridgelessArchitecture(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<834b0e9533cbc775a1c12b86140d718d>>
* @generated SignedSource<<c70f18dcde654a51d6edf6a227abb467>>
*/

/**
Expand All @@ -29,8 +29,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun cxxNativeAnimatedEnabled(): Boolean = true

override fun defaultTextToOverflowHidden(): Boolean = true

override fun deferTextInputTruncationIOS(): Boolean = false

override fun disableEarlyViewCommandExecution(): Boolean = false
Expand All @@ -53,8 +51,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun enableAliasedTextRoleInheritance(): Boolean = false

override fun enableAndroidTextMeasurementOptimizations(): Boolean = true

override fun enableAsyncDiskCacheCheckInMultiSourceImageAndroid(): Boolean = false

override fun enableBridgelessArchitecture(): Boolean = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<15c65d4497fd9f36f8902efb2812b3b2>>
* @generated SignedSource<<bb8da557c69699d91b2a47a5f0b6693d>>
*/

/**
Expand All @@ -27,7 +27,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var commonTestFlagCache: Boolean? = null
private var cdpInteractionMetricsEnabledCache: Boolean? = null
private var cxxNativeAnimatedEnabledCache: Boolean? = null
private var defaultTextToOverflowHiddenCache: Boolean? = null
private var deferTextInputTruncationIOSCache: Boolean? = null
private var disableEarlyViewCommandExecutionCache: Boolean? = null
private var disableIdleEventDispatchFrameCallbackRearmAndroidCache: Boolean? = null
Expand All @@ -39,7 +38,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableAccessibilityOrderCache: Boolean? = null
private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
private var enableAliasedTextRoleInheritanceCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableAsyncDiskCacheCheckInMultiSourceImageAndroidCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
Expand Down Expand Up @@ -159,16 +157,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun defaultTextToOverflowHidden(): Boolean {
var cached = defaultTextToOverflowHiddenCache
if (cached == null) {
cached = currentProvider.defaultTextToOverflowHidden()
accessedFeatureFlags.add("defaultTextToOverflowHidden")
defaultTextToOverflowHiddenCache = cached
}
return cached
}

override fun deferTextInputTruncationIOS(): Boolean {
var cached = deferTextInputTruncationIOSCache
if (cached == null) {
Expand Down Expand Up @@ -279,16 +267,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun enableAndroidTextMeasurementOptimizations(): Boolean {
var cached = enableAndroidTextMeasurementOptimizationsCache
if (cached == null) {
cached = currentProvider.enableAndroidTextMeasurementOptimizations()
accessedFeatureFlags.add("enableAndroidTextMeasurementOptimizations")
enableAndroidTextMeasurementOptimizationsCache = cached
}
return cached
}

override fun enableAsyncDiskCacheCheckInMultiSourceImageAndroid(): Boolean {
var cached = enableAsyncDiskCacheCheckInMultiSourceImageAndroidCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<89f683cb28a7d1ef52c86faa96f1107c>>
* @generated SignedSource<<6b0698016e65e47c75ec42ee8ac7ad2d>>
*/

/**
Expand All @@ -29,8 +29,6 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun cxxNativeAnimatedEnabled(): Boolean

@DoNotStrip public fun defaultTextToOverflowHidden(): Boolean

@DoNotStrip public fun deferTextInputTruncationIOS(): Boolean

@DoNotStrip public fun disableEarlyViewCommandExecution(): Boolean
Expand All @@ -53,8 +51,6 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun enableAliasedTextRoleInheritance(): Boolean

@DoNotStrip public fun enableAndroidTextMeasurementOptimizations(): Boolean

@DoNotStrip public fun enableAsyncDiskCacheCheckInMultiSourceImageAndroid(): Boolean

@DoNotStrip public fun enableBridgelessArchitecture(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ internal object TextLayoutManager {
outputReactTags: IntArray?,
textEffectRegistry: TextEffectRegistry? = null,
): Spannable {
if (ReactNativeFeatureFlags.enableAndroidTextMeasurementOptimizations()) {
if (ReactNativeFeatureFlags.enablePreparedTextLayout()) {
val spannable =
buildSpannableFromFragmentsOptimized(
assets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<407c8e5915db07bb6cc2b9ba4449750a>>
* @generated SignedSource<<079bb5c7c62e2c4d0754ec2235665bd0>>
*/

/**
Expand Down Expand Up @@ -57,12 +57,6 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool defaultTextToOverflowHidden() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("defaultTextToOverflowHidden");
return method(javaProvider_);
}

bool deferTextInputTruncationIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("deferTextInputTruncationIOS");
Expand Down Expand Up @@ -129,12 +123,6 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool enableAndroidTextMeasurementOptimizations() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableAndroidTextMeasurementOptimizations");
return method(javaProvider_);
}

bool enableAsyncDiskCacheCheckInMultiSourceImageAndroid() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableAsyncDiskCacheCheckInMultiSourceImageAndroid");
Expand Down Expand Up @@ -682,11 +670,6 @@ bool JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled(
return ReactNativeFeatureFlags::cxxNativeAnimatedEnabled();
}

bool JReactNativeFeatureFlagsCxxInterop::defaultTextToOverflowHidden(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::defaultTextToOverflowHidden();
}

bool JReactNativeFeatureFlagsCxxInterop::deferTextInputTruncationIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::deferTextInputTruncationIOS();
Expand Down Expand Up @@ -742,11 +725,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableAliasedTextRoleInheritance(
return ReactNativeFeatureFlags::enableAliasedTextRoleInheritance();
}

bool JReactNativeFeatureFlagsCxxInterop::enableAndroidTextMeasurementOptimizations(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableAndroidTextMeasurementOptimizations();
}

bool JReactNativeFeatureFlagsCxxInterop::enableAsyncDiskCacheCheckInMultiSourceImageAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableAsyncDiskCacheCheckInMultiSourceImageAndroid();
Expand Down Expand Up @@ -1227,9 +1205,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"cxxNativeAnimatedEnabled",
JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled),
makeNativeMethod(
"defaultTextToOverflowHidden",
JReactNativeFeatureFlagsCxxInterop::defaultTextToOverflowHidden),
makeNativeMethod(
"deferTextInputTruncationIOS",
JReactNativeFeatureFlagsCxxInterop::deferTextInputTruncationIOS),
Expand Down Expand Up @@ -1263,9 +1238,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableAliasedTextRoleInheritance",
JReactNativeFeatureFlagsCxxInterop::enableAliasedTextRoleInheritance),
makeNativeMethod(
"enableAndroidTextMeasurementOptimizations",
JReactNativeFeatureFlagsCxxInterop::enableAndroidTextMeasurementOptimizations),
makeNativeMethod(
"enableAsyncDiskCacheCheckInMultiSourceImageAndroid",
JReactNativeFeatureFlagsCxxInterop::enableAsyncDiskCacheCheckInMultiSourceImageAndroid),
Expand Down
Loading
Loading