-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Reland "Refactor OverlayPortal semantics (#173005)" #178095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request relands the refactoring of OverlayPortal semantics and includes a fix for an infinite loop. The changes introduce traversalParent and hitTestTransform to correctly handle semantics for overlays, separating traversal order from paint/hit-test order. This is a significant and wide-ranging change across the engine and framework. The implementation is mostly solid, but I have identified a few areas for improvement. I've pointed out a potential race condition in the semantics update logic, a minor bug in aria-owns handling on the web, and a code duplication in the C++ part of the engine.
455d99f to
fb7cc8f
Compare
| required String? identifier, | ||
| required Object? traversalParentIdentifier, | ||
| required Set<Object>? traversalChildIdentifier, | ||
| required Object? traversalChildIdentifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be Object instead of Set<Object>?. This is missed because we haven't directly used it in OverlayPortal. Catched this when adding tests.
fb7cc8f to
87a7eb5
Compare
| // updatedChildren list. | ||
| continue; | ||
| // | ||
| // A corner case is the traversal parent of the traversal child, in paint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so something like this?
// assume root node id is 0
Semantics(
// assume semantics node id = 1
traversalParent: 'key',
child: Semantics(
// assume semantics node id = 2
traversalChildren: 'key',
)
)
In this case I assume we want the hittest tree to be
0 -> 1 -> 2
but traversal tree to be
0 -> 2 -> 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked with @chunhtai offline. In this case we throw exception to indicate wrong parent-child relationship. Also update SemanticsConfiguration.isCompatibleWith to avoid implicit merging.
85c3596 to
ddf67f6
Compare
ddf67f6 to
4e9b287
Compare
7d4f799 to
1c1aa5a
Compare
…78095) Reverts flutter#178007 This PR is to reland flutter#173005 and add a fix to avoid infinite loop. The fix doesn't contain engine changes.
…78095) Reverts flutter#178007 This PR is to reland flutter#173005 and add a fix to avoid infinite loop. The fix doesn't contain engine changes.
…78095) Reverts flutter#178007 This PR is to reland flutter#173005 and add a fix to avoid infinite loop. The fix doesn't contain engine changes.
Reverts #178007
This PR is to reland #173005 and add a fix to avoid infinite loop. The fix doesn't contain engine changes.