Skip to content

Conversation

@QuncCccccc
Copy link
Contributor

@QuncCccccc QuncCccccc commented Nov 6, 2025

Reverts #178007

This PR is to reland #173005 and add a fix to avoid infinite loop. The fix doesn't contain engine changes.

@QuncCccccc QuncCccccc requested review from a team as code owners November 6, 2025 06:12
@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests platform-android Android applications specifically platform-ios iOS applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-windows Building on or for Windows specifically platform-web Web applications specifically platform-linux Building on or for Linux specifically a: desktop Running on desktop team-android Owned by Android platform team team-ios Owned by iOS platform team labels Nov 6, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@QuncCccccc QuncCccccc force-pushed the revert-178007-revert-173005 branch 2 times, most recently from 455d99f to fb7cc8f Compare November 6, 2025 12:26
required String? identifier,
required Object? traversalParentIdentifier,
required Set<Object>? traversalChildIdentifier,
required Object? traversalChildIdentifier,
Copy link
Contributor Author

@QuncCccccc QuncCccccc Nov 6, 2025

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.

@QuncCccccc QuncCccccc force-pushed the revert-178007-revert-173005 branch from fb7cc8f to 87a7eb5 Compare November 6, 2025 13:31
@QuncCccccc QuncCccccc requested a review from chunhtai November 6, 2025 13:33
// updatedChildren list.
continue;
//
// A corner case is the traversal parent of the traversal child, in paint
Copy link
Contributor

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

Copy link
Contributor Author

@QuncCccccc QuncCccccc Nov 6, 2025

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.

@QuncCccccc QuncCccccc force-pushed the revert-178007-revert-173005 branch from 85c3596 to ddf67f6 Compare November 6, 2025 23:17
@QuncCccccc QuncCccccc requested a review from chunhtai November 6, 2025 23:18
@QuncCccccc QuncCccccc force-pushed the revert-178007-revert-173005 branch from ddf67f6 to 4e9b287 Compare November 7, 2025 00:58
@QuncCccccc QuncCccccc force-pushed the revert-178007-revert-173005 branch from 7d4f799 to 1c1aa5a Compare November 9, 2025 08:40
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
…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.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
…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.
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: desktop Running on desktop a: tests "flutter test", flutter_test, or one of our tests engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-ios iOS applications specifically platform-linux Building on or for Linux specifically platform-web Web applications specifically platform-windows Building on or for Windows specifically team-android Owned by Android platform team team-ios Owned by iOS platform team will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants