Skip to content

Conversation

clocksmith
Copy link
Contributor

Description

Re-land #48985

This PR ensures that RenderFractionalTranslation calls markNeedsSemanticsUpdate after its translation is set/changed, so that semantics are properly updated (for instance if a FractionalTranslation is animating).

Related Issues

closes #20449

Tests

I added the following tests:

  • added test in proxy_box_test.dart to make sure that markNeedsSemanticsUpdate is called when changing the translation value.
  • added test in basic_test.dart to make sure that the semantics bounds get updated from a FractionalTranslation translation change

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.
    • I wrote a design doc: https://flutter.dev/go/template Replace this with a link to your design doc's short link
    • I got input from the developer relations team, specifically from: Replace with the names of who gave advice
    • I wrote a migration guide: Replace with a link to your migration guide

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Jan 29, 2020
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@clocksmith clocksmith merged commit 6a74be5 into flutter:master Jan 29, 2020
@clocksmith clocksmith deleted the fractional-translation-semantics-fix branch February 28, 2020 01:07
@flar
Copy link
Contributor

flar commented Apr 21, 2020

This change had a dramatic impact on the frame build times as can be seen in the flutter_gallery__transition_perf_with_semantics/delta_average_frame_build_time_millis benchmark on the flutter dashboard. The benchmark went from 2.4 to 7.4 milliseconds - or nearly triple the time.

@clocksmith
Copy link
Contributor Author

@flar

This change fixed a critical a11y bug. Do you have any recommendations on how to preserve this behavior while remaining performant?

@flar
Copy link
Contributor

flar commented Apr 27, 2020

It looks like this change basically just enables some aspect of the semantics code for the ProxyBox so the performance hit is likely due to the performance of the semantics code.

I don't know enough about the semantics code to make an off-hand suggestion as to how to reduce its impact. Someone more familiar with semantics should look at why the performance hit was so dramatic.

@jonahwilliams
Copy link
Contributor

jonahwilliams commented Apr 27, 2020

Unfortunately the bug this change fixed was fairly severe, so the benchmark was baselined under incorrect conditions. Similar to a rendering benchmark that didn't do any rendering, the semantics benchmark didn't do any semantics updating :(

@jonahwilliams
Copy link
Contributor

That said, it is generally known that our semantics updates are computationally intensive.

@flar
Copy link
Contributor

flar commented Apr 27, 2020

Unfortunately the bug this change fixed was fairly severe, so the benchmark was baselined under incorrect conditions. Similar to a rendering benchmark that didn't do any rendering, the semantics benchmark didn't do any semantics updating :(

Well that explains the change. The issue should probably be closed then and the benchmark re-baselined?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semantic boxes are incorrect inside FractionalTranslation
5 participants