[web] Makes Tappable semantics behavior adaptive#182167
[web] Makes Tappable semantics behavior adaptive#182167auto-submit[bot] merged 6 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
The pull request refactors the Tappable and Selectable semantic behaviors to be more adaptive. The logic for enabling or disabling these behaviors, including adding/removing event listeners and DOM attributes, has been moved from the SemanticRole's initialization methods into the update() method of the respective SemanticBehavior classes. This improves modularity and ensures that behaviors dynamically respond to changes in the SemanticsObject's properties. Additionally, the SemanticScrollable class now lazily initializes its _scrollOverflowElement and centralizes cleanup logic in a new _cleanUp() method, enhancing resource management. New tests have been added for both Selectable and Tappable behaviors, covering the adaptive changes. The changes are well-implemented and improve the maintainability and correctness of the semantics system. No issues of medium, high, or critical severity were found.
|
|
||
| @override | ||
| bool get shouldAcceptPointerEvents => true; | ||
| bool get shouldAcceptPointerEvents => _isListening; |
There was a problem hiding this comment.
This is what actually fixes the bug
engine/src/flutter/lib/web_ui/lib/src/engine/semantics/scrollable.dart
Outdated
Show resolved
Hide resolved
engine/src/flutter/lib/web_ui/lib/src/engine/semantics/scrollable.dart
Outdated
Show resolved
Hide resolved
engine/src/flutter/lib/web_ui/lib/src/engine/semantics/tappable.dart
Outdated
Show resolved
Hide resolved
3636d9f to
8f2b726
Compare
|
autosubmit label was removed for flutter/flutter/182167, because - The status or check suite Linux linux_web_engine_tests has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/flutter/182167, because - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label. |
55b8b21 to
47113c9
Compare
|
autosubmit label was removed for flutter/flutter/182167, because - The status or check suite Windows tool_integration_tests_1_9 has failed. Please fix the issues identified (or deflake) before re-applying this label. |
47113c9 to
c71f0fc
Compare
<!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> fixes flutter#175119 mainly change how tappable and other classes work so that it can self shutoff when the semantics object change ## 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], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

fixes #175119
mainly change how tappable and other classes work so that it can self shutoff when the semantics object change
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.