Commit 4014305
authored
inlineImages: Setting of
Setting of the `crossorigin` attribute is not necessary for same-origin images, and causes an immediate image reload (albeit from cache) necessitating the use of a load event listener which subsequently mutates the snapshot. This change allows us to avoid the mutation of the snapshot for the same-origin case.
* Modify inlineImages test to remove delay and show that we can inline images without mutation
* Add an explicit test for when the `image.crossOrigin = 'anonymous';` method is necessary. Uses a combination of about:blank and our test server to simulate a cross-origin context
* Other test changes: there were some spurious rrweb mutations being generated by the addition of the crossorigin attribute that are now elimnated from the rrweb/__snapshots__/integration.test.ts.snap after this PR - this is goodimage.crossOrigin is not always necessary (rrweb-io#1468)1 parent 81c54ab commit 4014305
8 files changed
Lines changed: 95 additions & 117 deletions
File tree
- .changeset
- packages
- rrweb-snapshot
- src
- test
- __snapshots__
- html
- images
- rrweb/test/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
751 | | - | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
| |||
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
763 | | - | |
764 | | - | |
765 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
766 | 780 | | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | 781 | | |
771 | 782 | | |
772 | 783 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
218 | 269 | | |
219 | 270 | | |
220 | 271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 0 additions & 102 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12777 | 12777 | | |
12778 | 12778 | | |
12779 | 12779 | | |
12780 | | - | |
12781 | | - | |
12782 | | - | |
12783 | | - | |
12784 | | - | |
12785 | | - | |
12786 | | - | |
12787 | | - | |
12788 | | - | |
12789 | | - | |
12790 | | - | |
12791 | | - | |
12792 | | - | |
12793 | | - | |
12794 | | - | |
12795 | | - | |
12796 | | - | |
12797 | | - | |
12798 | | - | |
12799 | | - | |
12800 | | - | |
12801 | | - | |
12802 | | - | |
12803 | | - | |
12804 | | - | |
12805 | | - | |
12806 | | - | |
12807 | | - | |
12808 | | - | |
12809 | | - | |
12810 | | - | |
12811 | | - | |
12812 | | - | |
12813 | | - | |
12814 | 12780 | | |
12815 | 12781 | | |
12816 | 12782 | | |
| |||
13245 | 13211 | | |
13246 | 13212 | | |
13247 | 13213 | | |
13248 | | - | |
13249 | | - | |
13250 | | - | |
13251 | | - | |
13252 | | - | |
13253 | | - | |
13254 | | - | |
13255 | | - | |
13256 | | - | |
13257 | | - | |
13258 | | - | |
13259 | | - | |
13260 | | - | |
13261 | | - | |
13262 | | - | |
13263 | | - | |
13264 | | - | |
13265 | | - | |
13266 | | - | |
13267 | | - | |
13268 | | - | |
13269 | | - | |
13270 | | - | |
13271 | | - | |
13272 | | - | |
13273 | | - | |
13274 | | - | |
13275 | | - | |
13276 | | - | |
13277 | | - | |
13278 | | - | |
13279 | | - | |
13280 | | - | |
13281 | | - | |
13282 | 13214 | | |
13283 | 13215 | | |
13284 | 13216 | | |
| |||
13486 | 13418 | | |
13487 | 13419 | | |
13488 | 13420 | | |
13489 | | - | |
13490 | | - | |
13491 | | - | |
13492 | | - | |
13493 | | - | |
13494 | | - | |
13495 | | - | |
13496 | | - | |
13497 | | - | |
13498 | | - | |
13499 | | - | |
13500 | | - | |
13501 | | - | |
13502 | | - | |
13503 | | - | |
13504 | | - | |
13505 | | - | |
13506 | | - | |
13507 | | - | |
13508 | | - | |
13509 | | - | |
13510 | | - | |
13511 | | - | |
13512 | | - | |
13513 | | - | |
13514 | | - | |
13515 | | - | |
13516 | | - | |
13517 | | - | |
13518 | | - | |
13519 | | - | |
13520 | | - | |
13521 | | - | |
13522 | | - | |
13523 | 13421 | | |
13524 | 13422 | | |
13525 | 13423 | | |
| |||
0 commit comments