Repository navigation
Commit c7f49fe
Fix mismatch between hit-test tree and traversal tree (#186826)
This PR is to update hit-test tree to make sure traversal tree and
hit-test tree have the same number of nodes, even though they can have
different shapes.
In OverlayPortal, if the child node is a traversal child, but the
current node is not a traversal parent, it means the child node should
be grafted to be a child of a traversal parent node that has the same
identifier as the child. However, if the traversal parent is not in the
tree, after grafting, the child will not be in the tree as well. To keep
the hit-test tree match the traversal tree, we also skip this node in
childrenInHitTestOrder. Otherwise, the number of nodes in two trees will
be different and user might accidentally hit test a node that will never
be traversed.
Fixes #184898
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
---------
Co-authored-by: chunhtai <[email protected]>1 parent d742b87 commit c7f49fe
2 files changed
Lines changed: 73 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
4055 | 4056 | | |
4056 | 4057 | | |
4057 | 4058 | | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
4058 | 4088 | | |
4059 | 4089 | | |
4060 | 4090 | | |
| |||
4093 | 4123 | | |
4094 | 4124 | | |
4095 | 4125 | | |
4096 | | - | |
4097 | | - | |
4098 | | - | |
4099 | | - | |
4100 | | - | |
4101 | | - | |
4102 | | - | |
4103 | | - | |
| 4126 | + | |
4104 | 4127 | | |
4105 | 4128 | | |
4106 | 4129 | | |
| |||
4539 | 4562 | | |
4540 | 4563 | | |
4541 | 4564 | | |
4542 | | - | |
| 4565 | + | |
4543 | 4566 | | |
4544 | 4567 | | |
4545 | 4568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
270 | 308 | | |
271 | 309 | | |
272 | 310 | | |
| |||
413 | 451 | | |
414 | 452 | | |
415 | 453 | | |
| 454 | + | |
416 | 455 | | |
417 | 456 | | |
418 | 457 | | |
| |||
0 commit comments