Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Embedder] Refactor how semantic updates are mapped #44553

Merged
merged 3 commits into from
Aug 11, 2023

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Aug 9, 2023

This refactors how engine semantic updates are mapped to embedder semantic updates. There are no behavioral changes.

Part of flutter/flutter#119970, flutter/flutter#98948

Next pull request: #44616

Background

For flutter/flutter#119970, we will need to update the embedder API to add string attributes to semantic nodes' text values. There are multiple kinds of string attributes, and each text value can have multiple string attributes. This requires gnarly mapping code that's best kept out of embedder.cc.

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 and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

// Create a callback to notify the embedder of semantic updates
// using the new embedder callback 'update_semantics_callback2'.
flutter::PlatformViewEmbedder::UpdateSemanticsCallback
CreateNewEmbedderSemanticsUpdateCallback2(
Copy link
Member Author

@loic-sharma loic-sharma Aug 9, 2023

Choose a reason for hiding this comment

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

This was renamed to CreateEmbedderSemanticsUpdateCallbackV3 and moved down to below CreateEmbedderSemanticsUpdateCallbackV2.

// Create a callback to notify the embedder of semantic updates
// using the deprecated embedder callback 'update_semantics_callback'.
flutter::PlatformViewEmbedder::UpdateSemanticsCallback
CreateNewEmbedderSemanticsUpdateCallback(
Copy link
Member Author

Choose a reason for hiding this comment

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

This was renamed to CreateEmbedderSemanticsUpdateCallbackV2 and moved down to below CreateEmbedderSemanticsUpdateCallbackV1.

@loic-sharma loic-sharma marked this pull request as ready for review August 9, 2023 19:10
@loic-sharma loic-sharma added embedder Related to the embedder API accessibility labels Aug 9, 2023
Copy link
Contributor

@yaakovschectman yaakovschectman left a comment

Choose a reason for hiding this comment

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

LGTM

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 11, 2023
@auto-submit auto-submit bot merged commit 8679b37 into flutter:main Aug 11, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 11, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 11, 2023
…132407)

flutter/engine@622ded9...832e780

2023-08-11 [email protected] Allow macOS plugins to register as app delegates (flutter/engine#44587)
2023-08-11 [email protected] Roll Skia from 68ea92de8f29 to 7dd695d828cf (1 revision) (flutter/engine#44643)
2023-08-11 [email protected] Roll Dart SDK from 83f96a990792 to ade04f1beb2c (1 revision) (flutter/engine#44642)
2023-08-11 [email protected] Roll Skia from fa30af9c2b80 to 68ea92de8f29 (2 revisions) (flutter/engine#44641)
2023-08-11 [email protected] [Impeller] Added benchmark for advanced blend. (flutter/engine#44450)
2023-08-11 [email protected] [Embedder] Refactor how semantic updates are mapped (flutter/engine#44553)
2023-08-11 [email protected] Roll Skia from cfb9844091fa to fa30af9c2b80 (1 revision) (flutter/engine#44639)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
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 Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Aug 18, 2023
Flutter's `SemanticNode`s use [`StringAttribute`](https://api.flutter.dev/flutter/dart-ui/StringAttribute-class.html)s to provide additional information on text values for assistive technologies. This exposes the string attributes on the embedder API so that embedders can apply string attributes to their semantics trees.

Addresses flutter/flutter#119970
Part of flutter/flutter#98948

Previous pull request: #44553

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
This refactors how engine semantic updates are mapped to embedder semantic updates. There are no behavioral changes.

Part of flutter/flutter#119970, flutter/flutter#98948

Next PR: flutter#44616

## Background
For flutter/flutter#119970, we will need to update the embedder API to add string attributes to semantic nodes' text values. There are multiple kinds of string attributes, and each text value can have multiple string attributes. This requires gnarly mapping code that's best kept out of `embedder.cc`.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
Flutter's `SemanticNode`s use [`StringAttribute`](https://api.flutter.dev/flutter/dart-ui/StringAttribute-class.html)s to provide additional information on text values for assistive technologies. This exposes the string attributes on the embedder API so that embedders can apply string attributes to their semantics trees.

Addresses flutter/flutter#119970
Part of flutter/flutter#98948

Previous pull request: flutter#44553

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility autosubmit Merge PR when tree becomes green via auto submit App embedder Related to the embedder API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants