Repository navigation
Commit 625854c
committed
Fix owner-mismatch crash for OverlayPortal inside a deferred-mount parent
`_RenderDeferredLayoutBox.redepthChildren` unconditionally called
`_layoutSurrogate.redepthChild(this)`. When a parent like `Table` defers
adopting its render-object children until every row has been mounted,
the deferred-layout box is adopted by the theater (and gains a pipeline
`owner`) while the layout surrogate is still un-attached, so the
`child.owner == owner` assertion fires.
The opposite direction in `_RenderLayoutSurrogateProxyBox.redepthChildren`
already guards on `child.attached`. Mirror that guard here. The depth
invariant is restored when the surrogate is finally attached, because the
surrogate's own `redepthChildren` re-depths this box.
Adds a regression test placing an `OverlayPortal` (with `controller.show()`
called before mount, mirroring `Slider`) inside a `TableRow` and verifying
neither the assertion nor an exception fires and the overlay child is
present.
Fixes flutter#174133
Fixes flutter#1803371 parent c27ddc2 commit 625854c
2 files changed
Lines changed: 58 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2573 | 2573 | | |
2574 | 2574 | | |
2575 | 2575 | | |
2576 | | - | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
2577 | 2587 | | |
2578 | 2588 | | |
2579 | 2589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
921 | 921 | | |
922 | 922 | | |
923 | 923 | | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
924 | 971 | | |
925 | 972 | | |
926 | 973 | | |
| |||
0 commit comments