Commit e859293
feat(android): background-size, position and repeat styles (#52282)
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes android only changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.
## Changelog:
[ANDROID][ADDED] - Background size, position and repeat styles.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: #52282
Test Plan:
Merge the [JS](#52284) PR, rebuild android app and test RNTester app, it includes `BackgroundImageExample`. I have also added testcases for parsing syntax in JS.
https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92
Reviewed By: joevilches
Differential Revision: D82993837
Pulled By: jorge-cab
fbshipit-source-id: 52859e51d2c4bab27823d3eb913993fdfbb4c04d1 parent d8c2f1c commit e859293
File tree
12 files changed
+782
-64
lines changed- packages/react-native/ReactAndroid
- api
- src/main/java/com/facebook/react
- uimanager
- drawable
- style
- views/view
12 files changed
+782
-64
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3457 | 3457 | | |
3458 | 3458 | | |
3459 | 3459 | | |
3460 | | - | |
| 3460 | + | |
3461 | 3461 | | |
3462 | 3462 | | |
3463 | 3463 | | |
3464 | 3464 | | |
3465 | | - | |
| 3465 | + | |
| 3466 | + | |
3466 | 3467 | | |
3467 | 3468 | | |
3468 | 3469 | | |
| |||
4613 | 4614 | | |
4614 | 4615 | | |
4615 | 4616 | | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
4616 | 4620 | | |
4617 | 4621 | | |
4618 | 4622 | | |
| |||
4942 | 4946 | | |
4943 | 4947 | | |
4944 | 4948 | | |
4945 | | - | |
| 4949 | + | |
4946 | 4950 | | |
4947 | 4951 | | |
4948 | 4952 | | |
| |||
6701 | 6705 | | |
6702 | 6706 | | |
6703 | 6707 | | |
| 6708 | + | |
| 6709 | + | |
| 6710 | + | |
6704 | 6711 | | |
6705 | 6712 | | |
6706 | 6713 | | |
| |||
Lines changed: 49 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
69 | 91 | | |
70 | 92 | | |
71 | 93 | | |
| |||
82 | 104 | | |
83 | 105 | | |
84 | 106 | | |
| 107 | + | |
85 | 108 | | |
86 | 109 | | |
87 | 110 | | |
| 111 | + | |
88 | 112 | | |
89 | 113 | | |
90 | 114 | | |
| |||
133 | 157 | | |
134 | 158 | | |
135 | 159 | | |
| 160 | + | |
| 161 | + | |
136 | 162 | | |
137 | 163 | | |
138 | 164 | | |
| 165 | + | |
139 | 166 | | |
140 | 167 | | |
141 | 168 | | |
| |||
381 | 408 | | |
382 | 409 | | |
383 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
384 | 432 | | |
385 | 433 | | |
386 | 434 | | |
| |||
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 31 | + | |
| 32 | + | |
35 | 33 | | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 41 | + | |
| 42 | + | |
46 | 43 | | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
Lines changed: 0 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | | - | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
| |||
59 | 55 | | |
60 | 56 | | |
61 | 57 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 58 | | |
71 | 59 | | |
72 | 60 | | |
| |||
123 | 111 | | |
124 | 112 | | |
125 | 113 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 114 | | |
145 | 115 | | |
146 | 116 | | |
| |||
154 | 124 | | |
155 | 125 | | |
156 | 126 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 127 | | |
176 | 128 | | |
177 | 129 | | |
| |||
0 commit comments