Skip to content

fix(style)(backgroundSize) - Passing unsupported backgroundSize on android causes crash#55904

Open
intergalacticspacehighway wants to merge 3 commits intofacebook:mainfrom
intergalacticspacehighway:fix/remove-unsupported-backgroundsize
Open

fix(style)(backgroundSize) - Passing unsupported backgroundSize on android causes crash#55904
intergalacticspacehighway wants to merge 3 commits intofacebook:mainfrom
intergalacticspacehighway:fix/remove-unsupported-backgroundsize

Conversation

@intergalacticspacehighway
Copy link
Contributor

Summary:

Below snippet would lead to divide by zero crash on android. Currently, "cover | contain" keywords are not supported for background size as these only work on actual images (url() syntax) and not on gradients. These keywords were supposed to be removed in this commit and added later in this PR

<View
  style={{
    experimental_backgroundImage: "radial-gradient(circle, #f093fb, #f5576c)",
    experimental_backgroundSize: "cover",
    width: 100,
    height: 100
  }}
/>;

Changelog:

[ANDROID] [FIXED] - Unsupported background size value leading to crash

Test Plan:

Tested the BackgroundImage example on RNTester.

@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 Mar 4, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 4, 2026

@NickGerleman has imported this pull request. If you are a Meta employee, you can view this in D95202400.

@intergalacticspacehighway
Copy link
Contributor Author

Currently keeping these keywords in types as they have a lot of testcases in JS. These will behave no-op with gradient anyways. So i think it should be fine. Eventually we'll add them with #54994

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant