Commit ea0613c
Reject percentage radius for circle radial gradients
Per the CSS spec (css-images-3, <radial-size>), a circle's explicit
radius must be a <length> - percentages are only valid for ellipses.
Browsers reject the whole declaration for values such as
radial-gradient(circle 50%, red, blue), while React Native accepted
them and rendered an arbitrary interpretation (max of both resolved
axes), so the same style silently diverged between native and web.
processBackgroundImage now returns no gradient for a circle (explicit
or inferred from a single size) whose size is a percentage, matching
web behavior. Ellipses with percentage sizes are unaffected.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent adffc11 commit ea0613c
2 files changed
Lines changed: 26 additions & 0 deletions
File tree
- packages/react-native/Libraries/StyleSheet
- __tests__
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
989 | 1006 | | |
990 | 1007 | | |
991 | 1008 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
570 | 579 | | |
571 | 580 | | |
572 | 581 | | |
| |||
0 commit comments