Skip to content

Cover decimal and negative transformOrigin strings in RNTester (#59726) - #59726

Open
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D128838946
Open

Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D128838946

Conversation

@Abbondanzo

@Abbondanzo Abbondanzo commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

The string form of transformOrigin used to tokenize with \d+(?:%|px), which corrupted decimals and negatives: '52.9% 88.2%' parsed as ['9%', '2%', 0], '-12.5px -7.5px' as [5, 5, 0], and 'left -20.5%' threw in development. The parser now handles them, but RNTester's only transformOrigin example uses 'top left', so nothing renders or screenshots these values.

This adds a "Transform origin with decimal and negative values" example. Each case draws a pink box with a string origin over a dashed outline with the equivalent array origin, both rotated 45 degrees, so any parsing difference separates the two shapes. The Transform visual test now captures it, with the same anti-aliasing tolerance as the other rotated captures.

Changelog: [Internal]

Differential Revision: D128838946

@meta-codesync

meta-codesync Bot commented Oct 31, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128838946.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 31, 2026
…#59726)

Summary:

The string form of `transformOrigin` used to tokenize with `\d+(?:%|px)`, which corrupted decimals and negatives: `'52.9% 88.2%'` parsed as `['9%', '2%', 0]`, `'-12.5px -7.5px'` as `[5, 5, 0]`, and `'left -20.5%'` threw in development. The parser now handles them, but RNTester's only `transformOrigin` example uses `'top left'`, so nothing renders or screenshots these values.

This adds a "Transform origin with decimal and negative values" example. Each case draws a pink box with a string origin over a dashed outline with the equivalent array origin, both rotated 45 degrees, so any parsing difference separates the two shapes. The Transform visual test now captures it, with the same anti-aliasing tolerance as the other rotated captures.

Changelog: [Internal]

Differential Revision: D128838946
@meta-codesync meta-codesync Bot changed the title Cover decimal and negative transformOrigin strings in RNTester Cover decimal and negative transformOrigin strings in RNTester (#59726) Nov 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant