Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Dec 12, 2024

The original workaround (PR) works for the official web view plugin, but it doesn't work for a third party plugin flutter_inappwebview (issue). Upon discussion with the author of that plugin, it turns out that their platform view is not a WKWebView, but rather a wrapper of WKWebView.

This PR performs a DFS search of the view hierarchy, and enable the workaround as long as there's a WKWebView inside.

TODO: pending sample project:
I am quite positive that it should work, but I haven't tried it since I don't have a sample project yet. I have requested a sample project with them so I can verify the solution.

List which issues are fixed by this PR. You must list at least one issue.

pichillilorenzo/flutter_inappwebview#2415

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@hellohuanlin hellohuanlin changed the title [ios]enable the webview non tappable workaround by checking views [ios]enable the webview non tappable workaround by checking subviews recursively Dec 12, 2024
Comment on lines 597 to 598
[self removeGestureRecognizer:self.delayingRecognizer];
[self addGestureRecognizer:self.delayingRecognizer];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause problems in the views they are gesturing into that are not WKWebViews?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is possible. That's something that we need to watch out for. But I highly doubt if it is gonna cause real issues

Copy link
Contributor Author

@hellohuanlin hellohuanlin Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are talking about an odd of combining:

  1. having a setup with webview + another non-web-view subview that also handles gesture
  2. having a flutter overlay layer on top of this non-web-view subview
  3. User touch the area inside non-web-view subview, but outside of the overlay layer

Then we will have this non-web-view subview receive the extra touch when it's not supposed to.

Then even when this happens, I don't think it is a huge problem.

@hellohuanlin
Copy link
Contributor Author

I was able to verify this solution works in the sample project provided by the author of flutter_inappwebview

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 13, 2024
@auto-submit auto-submit bot merged commit 4402232 into flutter:main Dec 13, 2024
30 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 13, 2024
…160220)

flutter/engine@9b51e30...5eedfef

2024-12-13 [email protected] Normalize round rect bounds when coming from
Flutter (flutter/engine#57171)
2024-12-13 [email protected] [ios]enable
the webview non tappable workaround by checking subviews recursively
(flutter/engine#57168)
2024-12-12 [email protected] removed c style
casts and enabled the lint (flutter/engine#57162)
2024-12-12 [email protected] [Impeller] exploit perfect hash for
SamplerDescriptor. (flutter/engine#57036)
2024-12-12 [email protected] Reenabled
labelling test with a capabilities check. (flutter/engine#57160)
2024-12-12 [email protected] [Impeller] dont print format strings
for blend filter and snapshots. (flutter/engine#57105)
2024-12-12 [email protected] Make fl_engine_send_key_event
into a standard async function. (flutter/engine#57112)
2024-12-12 [email protected] Roll Fuchsia Linux SDK from
HJ57Y3zxqDamI8qkY... to iWMEbVYaNdH8RJmXZ... (flutter/engine#57163)
2024-12-12 [email protected] Migrate FlPlatformChannel tests
to FlMockBinaryMessenger (flutter/engine#57140)
2024-12-12 [email protected] Migrate FlBasicMessageChannel
tests to FlMockBinaryMessenger (flutter/engine#57115)
2024-12-12 [email protected] Migrate layers and layer_tree to
DisplayList/Impeller geometry classes (flutter/engine#57153)
2024-12-12 [email protected] [web] Use CanvasKit to run tests under
engine/ (flutter/engine#54786)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from HJ57Y3zxqDam to iWMEbVYaNdH8

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 [email protected],[email protected] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Dec 13, 2024
This PR limits the search depth, because we don't want to enable this workaround for AdMob banner, which has a WKWebView in the depth of 7. See the previous PR for more context: #57168

I was able to confirm that this returns YES for the 3P plugin, and NO for AdMob. 

*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#158961

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
auto-submit bot pushed a commit that referenced this pull request Dec 13, 2024
… subviews recursively #57168 (#57172)

CP for #57168 and #57193

*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#158961

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
auto-submit bot pushed a commit that referenced this pull request Dec 17, 2024
… AND "enable the webview non tappable workaround by checking subviews recursively #57168" (#57176)

CP for 3 PRs: #56804 and #57168 and  #57193

This is for 3.28.

Since the previous PR was not merged, so I combined the 2 PRs to make it easier to merge. 

*List which issues are fixed by this PR. You must list at least one issue.*
pichillilorenzo/flutter_inappwebview#2415

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…recursively (flutter/engine#57168)

The original workaround ([PR](flutter/engine#56804)) works for the official web view plugin, but it doesn't work for a third party plugin `flutter_inappwebview` ([issue](https://github.com/pichillilorenzo/flutter_inappwebview)). Upon discussion with the author of that plugin, it turns out that their platform view is not a WKWebView, but rather a wrapper of WKWebView. 

This PR performs a DFS search of the view hierarchy, and enable the workaround as long as there's a WKWebView inside. 

TODO: pending sample project:
I am quite positive that it should work, but **I haven't tried it since I don't have a sample project yet**. I have requested a sample project with them so I can verify the solution. 

*List which issues are fixed by this PR. You must list at least one issue.*

 pichillilorenzo/flutter_inappwebview#2415

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…er/engine#57193)

This PR limits the search depth, because we don't want to enable this workaround for AdMob banner, which has a WKWebView in the depth of 7. See the previous PR for more context: flutter/engine#57168

I was able to confirm that this returns YES for the 3P plugin, and NO for AdMob. 

*List which issues are fixed by this PR. You must list at least one issue.*
flutter#158961

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
phamnhuvu-dev pushed a commit to phamnhuvu-dev/engine that referenced this pull request Jan 7, 2025
… subviews recursively flutter#57168 (flutter#57172)

CP for flutter#57168 and flutter#57193

*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#158961

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants