Commit 70039d3
authored
[web] Do not wipe the PlatformViewManager when disposing of a view. (flutter#49991)
When a view gets disposed of, its rasterizer completely clears up the singleton `PlatformViewManager`. Particularly, it removes all registered platform view factories.
This is wrong because the remaining PlatformViews on the page cannot be re-rendered, and the default Platform View factories (used by `pointer_interceptor`, for example), disappear.
This PR attempts to preserve the `dispose` logic of the canvaskit rasterizer, without using the `debugClear` method of the `PlatformViewManager` (which is supposedly test-only).
## Issues
* Fixes flutter#142094
## Tests
* Added unit-test
* Deployed demo app: https://dit-maps-tests.web.app
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style1 parent 182b595 commit 70039d3
File tree
3 files changed
+29
-11
lines changed- lib/web_ui
- lib/src/engine
- canvaskit
- platform_views
- test/canvaskit
3 files changed
+29
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
414 | | - | |
| 413 | + | |
415 | 414 | | |
416 | 415 | | |
417 | 416 | | |
| |||
510 | 509 | | |
511 | 510 | | |
512 | 511 | | |
513 | | - | |
| 512 | + | |
514 | 513 | | |
515 | 514 | | |
516 | 515 | | |
| |||
659 | 658 | | |
660 | 659 | | |
661 | 660 | | |
662 | | - | |
663 | | - | |
| 661 | + | |
664 | 662 | | |
665 | 663 | | |
666 | 664 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 216 | + | |
| 217 | + | |
221 | 218 | | |
222 | 219 | | |
223 | 220 | | |
224 | 221 | | |
225 | | - | |
226 | 222 | | |
227 | 223 | | |
228 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
71 | 95 | | |
72 | 96 | | |
0 commit comments