[ios_platform_view] Only remove platform views from flutter view in reset.#41709
Conversation
| void FlutterPlatformViewsController::Reset() { | ||
| UIView* flutter_view = flutter_view_.get(); | ||
| for (UIView* sub_view in [flutter_view subviews]) { | ||
| if (![sub_view isKindOfClass:[ChildClippingView class]]) { |
There was a problem hiding this comment.
We shy away from RTTI-ish things in the engine. Can we avoid the same in ObjC TUs as well.
There was a problem hiding this comment.
There was a problem hiding this comment.
Good point, I will fix it. Also filed flutter/flutter#126868
There was a problem hiding this comment.
Interesting read. tho that means we will need to manually keep track of the child clipping views array, and keep that in sync with UIView::subviews. not sure if it's worth the effort.
There was a problem hiding this comment.
manually keep track of the child clipping views array
We have it: active_composition_order_
| UIView* flutter_view = flutter_view_.get(); | ||
| for (UIView* sub_view in [flutter_view subviews]) { | ||
| for (int64_t view_id : active_composition_order_) { | ||
| UIView* sub_view = root_views_[view_id].get(); |
There was a problem hiding this comment.
can you add a comment clarifying that there may be non-platform views left in flutter_view's subviews (which was the confusing part that have caused this bug right?)
There was a problem hiding this comment.
There wasn't any bug AFAIK. The old code was just not careful about what to remove.
I agree if we used the old approach with (isKindOf), a comment is helpful.
The new approach doesn't even assume the super view is flutter view. I'm not sure what I should say in a comment to not make it confusing.
flutter-team-archive/engine@c4d4b40...d7a5de6 2023-05-16 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from JCoP2Fekj3MBIqskE... to N4LwCRxg0oIevhQ_O... (flutter-team-archive/engine#42070) 2023-05-16 zhangzhijian.123@bytedance.com [Impeller] Fix issue about saveLayer ignoring opacity of paint with advanced blend mode (flutter-team-archive/engine#41972) 2023-05-16 ychris@google.com [ios_platform_view] Only remove platform views from flutter view in reset. (flutter-team-archive/engine#41709) 2023-05-16 godofredoc@google.com Add drone_dimensions as top level target property. (flutter-team-archive/engine#42064) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from JCoP2Fekj3MB to N4LwCRxg0oIe If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…6919) flutter-team-archive/engine@c4d4b40...d7a5de6 2023-05-16 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from JCoP2Fekj3MBIqskE... to N4LwCRxg0oIevhQ_O... (flutter-team-archive/engine#42070) 2023-05-16 zhangzhijian.123@bytedance.com [Impeller] Fix issue about saveLayer ignoring opacity of paint with advanced blend mode (flutter-team-archive/engine#41972) 2023-05-16 ychris@google.com [ios_platform_view] Only remove platform views from flutter view in reset. (flutter-team-archive/engine#41709) 2023-05-16 godofredoc@google.com Add drone_dimensions as top level target property. (flutter-team-archive/engine#42064) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from JCoP2Fekj3MB to N4LwCRxg0oIe If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Add a class type check during reset when removing the PlatformViews.
Fixes: flutter/flutter#125999
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.