Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove gating for rtl swapping fix + clean Paragraph Yoga node #42297

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ public class ReactFeatureFlags {
/** Use native view configs in bridgeless mode. */
public static boolean useNativeViewConfigsInBridgelessMode = false;

/** Only swap left and right on Android in RTL scripts. */
public static boolean doNotSwapLeftAndRightOnAndroidInLTR = false;

/** Clean yoga node when <Text /> does not change. */
public static boolean enableCleanParagraphYogaNode = false;

/** Default state updates and events to async batched priority. */
public static boolean enableDefaultAsyncBatchedPriority = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,6 @@ void Binding::installFabricUIManager(

CoreFeatures::enablePropIteratorSetter =
getFeatureFlagValue("enableCppPropsIteratorSetter");
CoreFeatures::doNotSwapLeftAndRightOnAndroidInLTR =
getFeatureFlagValue("doNotSwapLeftAndRightOnAndroidInLTR");
CoreFeatures::enableCleanParagraphYogaNode =
getFeatureFlagValue("enableCleanParagraphYogaNode");
CoreFeatures::enableDefaultAsyncBatchedPriority =
getFeatureFlagValue("enableDefaultAsyncBatchedPriority");
CoreFeatures::enableClonelessStateProgression =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ ParagraphShadowNode::ParagraphShadowNode(
const ShadowNode& sourceShadowNode,
const ShadowNodeFragment& fragment)
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
if (CoreFeatures::enableCleanParagraphYogaNode) {
if (!fragment.children && !fragment.props) {
// This ParagraphShadowNode was cloned but did not change
// in a way that affects its layout. Let's mark it clean
// to stop Yoga from traversing it.
cleanLayout();
}
if (!fragment.children && !fragment.props) {
// This ParagraphShadowNode was cloned but did not change
// in a way that affects its layout. Let's mark it clean
// to stop Yoga from traversing it.
cleanLayout();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ void YogaLayoutableShadowNode::layoutTree(
SystraceSection s1("YogaLayoutableShadowNode::layoutTree");

bool swapLeftAndRight = layoutContext.swapLeftAndRightInRTL &&
(layoutConstraints.layoutDirection == LayoutDirection::RightToLeft ||
!CoreFeatures::doNotSwapLeftAndRightOnAndroidInLTR);
layoutConstraints.layoutDirection == LayoutDirection::RightToLeft;

{
SystraceSection s2("YogaLayoutableShadowNode::configureYogaTree");
Expand Down Expand Up @@ -699,8 +698,7 @@ void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) {
newLayoutMetrics.pointScaleFactor = layoutContext.pointScaleFactor;
newLayoutMetrics.wasLeftAndRightSwapped =
layoutContext.swapLeftAndRightInRTL &&
(newLayoutMetrics.layoutDirection == LayoutDirection::RightToLeft ||
!CoreFeatures::doNotSwapLeftAndRightOnAndroidInLTR);
newLayoutMetrics.layoutDirection == LayoutDirection::RightToLeft;

// Child node's layout has changed. When a node is added to
// `affectedNodes`, onLayout event is called on the component. Comparing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ bool CoreFeatures::cacheLastTextMeasurement = false;
bool CoreFeatures::cancelImageDownloadsOnRecycle = false;
bool CoreFeatures::enableGranularScrollViewStateUpdatesIOS = false;
bool CoreFeatures::enableMountHooks = false;
bool CoreFeatures::doNotSwapLeftAndRightOnAndroidInLTR = false;
bool CoreFeatures::enableCleanParagraphYogaNode = false;
bool CoreFeatures::enableGranularShadowTreeStateReconciliation = false;
bool CoreFeatures::enableDefaultAsyncBatchedPriority = false;
bool CoreFeatures::enableClonelessStateProgression = false;
Expand Down
6 changes: 0 additions & 6 deletions packages/react-native/ReactCommon/react/utils/CoreFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ class CoreFeatures {
// Report mount operations from the host platform to notify mount hooks.
static bool enableMountHooks;

// Only swap left and right on Android in RTL scripts.
static bool doNotSwapLeftAndRightOnAndroidInLTR;

// Clean yoga node when <Text /> does not change.
static bool enableCleanParagraphYogaNode;

// When enabled, the renderer would only fail commits when they propagate
// state and the last commit that updated state changed before committing.
static bool enableGranularShadowTreeStateReconciliation;
Expand Down
Loading