Skip to content

Conversation

@LongCatIsLooong
Copy link
Contributor

Fixes #134456

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.
  • All existing and new tests are passing.

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

@LongCatIsLooong LongCatIsLooong changed the title OverlayPortal.overlayChild contributes semantics to OverlayPortal instead of Overlay/ OverlayPortal.overlayChild contributes semantics to OverlayPortal instead of Overlay Sep 18, 2023
@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 18, 2023
@LongCatIsLooong LongCatIsLooong marked this pull request as ready for review September 18, 2023 08:11
@goderbauer
Copy link
Member

Looks like google testing is unhappy.

@LongCatIsLooong
Copy link
Contributor Author

Looks like an infra thing I'll squash the commits.

@LongCatIsLooong LongCatIsLooong force-pushed the overlayportal-semantics branch 2 times, most recently from 709d8c2 to 546ccb0 Compare September 19, 2023 19:53
Copy link
Contributor

Choose a reason for hiding this comment

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

semanticsParent/semanticsChild are confusing names. maybe something like parentWithInterestingFragment or childWithInterestingFragment

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 even if a render object generated a ContainerFragment it is still going to be in this list.

Copy link
Contributor

Choose a reason for hiding this comment

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

what about parentInSemanticsFragmentOrder and childInSemanticsFragmentOrder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to parent/childFragmentOwner

Copy link
Contributor

Choose a reason for hiding this comment

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

It took me awhile to understand this only traverse child added from overlayportal. Can you add some doc to visitChildrenOfOverlayEntry or maybe rename it to something like visitOverlayPortalChildren?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought it would still come to this case if there are rendering object that creates _ContainerSemanticsFragment inbetween semanticsChild and semanticsParent ?

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 ran existing tests with a print statement and it seems that isn't happening in tests. In _getSemanticsForParent, every fragment in the sibling merge/merge up groups calls addAncestor(this).

Copy link
Contributor

Choose a reason for hiding this comment

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

what happen if this loop past semanticsParent?

Copy link
Contributor Author

@LongCatIsLooong LongCatIsLooong Sep 24, 2023

Choose a reason for hiding this comment

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

At least in the case of OverlayPortal, the final ancestor will be an ancestor of semanticsParent. Unfortunately we don't cache the clipping results from semanticsParent and semanticsChild's common ancestor so we can't utilize the previously computed clipping rects.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes I understood the logic now, makes sense

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this!

Copy link
Contributor

Choose a reason for hiding this comment

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

nits: format

Copy link
Contributor

Choose a reason for hiding this comment

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

yes I understood the logic now, makes sense

Copy link
Contributor

Choose a reason for hiding this comment

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

what about parentInSemanticsFragmentOrder and childInSemanticsFragmentOrder

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// A convenience method for accessing `paintOrderIterator` using a
// A convenience method for accessing `paintOrderIterator` with a

@github-actions github-actions bot added the f: material design flutter/packages/flutter/material repository. label Sep 30, 2023
@LongCatIsLooong
Copy link
Contributor Author

Added a Semantics(container: true) to the tooltip on the overlay to prevent the semantics of tooltip's text from merging with that of Tooltip.child.

LongCatIsLooong added a commit to LongCatIsLooong/website that referenced this pull request Sep 30, 2023
LongCatIsLooong added a commit to LongCatIsLooong/website that referenced this pull request Sep 30, 2023
@LongCatIsLooong
Copy link
Contributor Author

LongCatIsLooong commented Oct 18, 2023

Hi @gspencergoog does the semantics tree change in menu_anchor_tests.dart make sense to you?

BEFORE AFTER
SemanticsNode#0
 │ Rect.fromLTRB(0.0, 0.0, 2400.0, 1800.0)
 │
 └─SemanticsNode#1
   │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0) scaled by 3.0x
   │ textDirection: ltr
   │
   ├─SemanticsNode#2
   │ │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
   │ │ sortKey: OrdinalSortKey#8299f(order: 0.0)
   │ │
   │ └─SemanticsNode#3
   │   │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
   │   │ flags: scopesRoute
   │   │
   │   └─SemanticsNode#4
   │     │ merge boundary ⛔️
   │     │ Rect.fromLTRB(356.0, 276.0, 444.0, 324.0)
   │     │ flags: hasExpandedState, isExpanded
   │     │
   │     └─SemanticsNode#5
   │         merged up ⬆️
   │         Rect.fromLTRB(0.0, 0.0, 88.0, 48.0)
   │         actions: tap
   │         flags: isFocused, hasEnabledState, isEnabled, isFocusable
   │         label: "ABC"
   │         textDirection: ltr
   │
   └─SemanticsNode#6
     │ Rect.fromLTRB(356.0, 316.0, 476.0, 380.0)
     │ thickness: 3.0
     │
     └─SemanticsNode#7
       │ Rect.fromLTRB(0.0, 8.0, 120.0, 56.0)
       │ flags: hasImplicitScrolling
       │ scrollExtentMin: 0.0
       │ scrollPosition: 0.0
       │ scrollExtentMax: 0.0
       │ elevation: 3.0
       │
       └─SemanticsNode#8
         │ merge boundary ⛔️
         │ Rect.fromLTRB(0.0, 0.0, 120.0, 48.0)
         │
         └─SemanticsNode#9
             merged up ⬆️
             Rect.fromLTRB(0.0, 0.0, 120.0, 48.0)
             actions: tap
             flags: hasEnabledState, isEnabled, isFocusable
             label: "Item 0"
             textDirection: ltr
SemanticsNode#0
 │ Rect.fromLTRB(0.0, 0.0, 2400.0, 1800.0)
 │
 └─SemanticsNode#1
   │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0) scaled by 3.0x
   │ textDirection: ltr
   │
   └─SemanticsNode#2
     │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
     │ sortKey: OrdinalSortKey#bfee0(order: 0.0)
     │
     └─SemanticsNode#3
       │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
       │ flags: scopesRoute
       │
       ├─SemanticsNode#4
       │ │ merge boundary ⛔️
       │ │ Rect.fromLTRB(356.0, 276.0, 444.0, 324.0)
       │ │ flags: hasExpandedState, isExpanded
       │ │
       │ └─SemanticsNode#5
       │     merged up ⬆️
       │     Rect.fromLTRB(0.0, 0.0, 88.0, 48.0)
       │     actions: tap
       │     flags: isFocused, hasEnabledState, isEnabled, isFocusable
       │     label: "ABC"
       │     textDirection: ltr
       │
       └─SemanticsNode#6
         │ Rect.fromLTRB(356.0, 316.0, 476.0, 380.0)
         │ thickness: 3.0
         │
         └─SemanticsNode#7
           │ Rect.fromLTRB(0.0, 8.0, 120.0, 56.0)
           │ flags: hasImplicitScrolling
           │ scrollExtentMin: 0.0
           │ scrollPosition: 0.0
           │ scrollExtentMax: 0.0
           │ elevation: 3.0
           │
           └─SemanticsNode#8
             │ merge boundary ⛔️
             │ Rect.fromLTRB(0.0, 0.0, 120.0, 48.0)
             │
             └─SemanticsNode#9
                 merged up ⬆️
                 Rect.fromLTRB(0.0, 0.0, 120.0, 48.0)
                 actions: tap
                 flags: hasEnabledState, isEnabled, isFocusable
                 label: "Item 0"
                 textDirection: ltr

@gspencergoog
Copy link
Contributor

Honestly, I don't see any difference in those two trees.

@LongCatIsLooong
Copy link
Contributor Author

LongCatIsLooong commented Oct 18, 2023

Honestly, I don't see any difference in those two trees.

Oops sorry copied the wrong tree. Updated the comment.

@gspencergoog
Copy link
Contributor

Okay, if I understand that correctly, it sounds OK to me.

@LongCatIsLooong LongCatIsLooong force-pushed the overlayportal-semantics branch from d8ce12e to c59fe2c Compare October 19, 2023 00:38
LongCatIsLooong added a commit to LongCatIsLooong/website that referenced this pull request Oct 19, 2023
@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 23, 2023
@auto-submit auto-submit bot merged commit af129b6 into flutter:master Oct 23, 2023
@LongCatIsLooong LongCatIsLooong deleted the overlayportal-semantics branch October 23, 2023 15:46
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 23, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 23, 2023
flutter/flutter@823e083...5e8b5f4

2023-10-23 [email protected] Update `ColorScheme.fromSwatch` docs for Material 3 (flutter/flutter#136816)
2023-10-23 [email protected] Reland "Fixes ability to call nextFocus() on a node to focus its descâ�¦ (flutter/flutter#136898)
2023-10-23 [email protected] `OverlayPortal.overlayChild` contributes semantics to `OverlayPortal` instead of `Overlay` (flutter/flutter#134921)
2023-10-23 [email protected] Roll Packages from be915be to 4bf5114 (12 revisions) (flutter/flutter#137062)
2023-10-23 [email protected] Roll Flutter Engine from 8820a419c800 to 1dc66e8f2fba (1 revision) (flutter/flutter#137055)
2023-10-23 [email protected] Roll Flutter Engine from e2abdeb650f8 to 8820a419c800 (1 revision) (flutter/flutter#137051)
2023-10-23 [email protected] Roll Flutter Engine from 39f78ce1884d to e2abdeb650f8 (1 revision) (flutter/flutter#137050)
2023-10-23 [email protected] Roll Flutter Engine from 4899344c34d9 to 39f78ce1884d (1 revision) (flutter/flutter#137048)
2023-10-23 [email protected] Roll Flutter Engine from 9d05b061e245 to 4899344c34d9 (1 revision) (flutter/flutter#137046)
2023-10-23 [email protected] Roll Flutter Engine from cde34b8182b1 to 9d05b061e245 (1 revision) (flutter/flutter#137044)
2023-10-22 [email protected] Add timeline events for post frame callbacks (flutter/flutter#136435)
2023-10-22 [email protected] Roll Flutter Engine from b8d702c0e0d7 to cde34b8182b1 (1 revision) (flutter/flutter#137038)
2023-10-22 [email protected] Roll Flutter Engine from f3c7a50bc83f to b8d702c0e0d7 (1 revision) (flutter/flutter#137035)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
parlough added a commit to flutter/website that referenced this pull request Oct 23, 2023
Breaking change announcement for
flutter/flutter#134921

---------

Co-authored-by: Parker Lougheed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OverlayPortal doesn't interleave overlay in the widget semantics

4 participants