Skip to content

Reland (#167738) but with some flags updated to use enum #170505

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

Merged
merged 7 commits into from
Jun 13, 2025

Conversation

hannah-hyj
Copy link
Member

@hannah-hyj hannah-hyj commented Jun 12, 2025

Reland (#167738) : [a11y] Semantics flag refactor step 2: embedder part with some updates

The original PR was reverted because the changes to embedder should be in one PR to avoid introducing breaking changes.

This PR contains 2 commits, one commit of re-landing #167738 and one commit of new enum updates.

new Updates :
Add new enum FlutterTristate and FlutterCheckState in embedder.h for 7 flags.
For CheckState, it used to use 3 bools (hasCheck, isChecked, isCheckStateMixed) to represent check states, replace them with a FlutterCheckState enum.
For other 6 flags, each has 2 bools (hasXXState and isXX), replace them with a FlutterTristate enum.

TODO:
Will also update these flags in dart:ui and framework to be tristate too in another PR, this PR is only for embedder.

Pre-launch Checklist

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

issue: flutter#166101, overall goal is
to update semantics flag to be a struct/class to support more than 32
flags.


step 1: flutter#167421 updated
semantics_node.h and dart:ui
step 2(this PR): Update Embedder part to use a struct instead of a int
bit mask.
step 3: flutter#167771 Update Framework
use the SemanticsFlags class instead of bitmask
step 4 flutter#168852 Update web engine
to use the new class and update SemanticsUpdateBuilder.updateNode to
pass the new class instead of bitmask

## 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].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Chris Bracken <[email protected]>
Co-authored-by: Loïc Sharma <[email protected]>
@github-actions github-actions bot added engine flutter/engine repository. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-windows Building on or for Windows specifically platform-linux Building on or for Linux specifically a: desktop Running on desktop platform-macos labels Jun 12, 2025
@hannah-hyj hannah-hyj changed the title Reland [a11y] Semantics flag refactor step 2: embedder part (#167738) but with some flags updated to use enum Reland (#167738) but with some flags updated to use enum Jun 12, 2025
@hannah-hyj hannah-hyj force-pushed the semanticsflags-embedder-2 branch from 004f39e to b600529 Compare June 12, 2025 05:07
@hannah-hyj hannah-hyj requested a review from chunhtai June 12, 2025 05:10
@hannah-hyj hannah-hyj force-pushed the semanticsflags-embedder-2 branch from b600529 to 53b72ee Compare June 12, 2025 06:46
Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

Thanks for doing this, it's a nice improvement! :)

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

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 12, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jun 13, 2025
Merged via the queue into flutter:master with commit 978ef6b Jun 13, 2025
181 of 182 checks passed
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 engine flutter/engine repository. See also e: labels. platform-linux Building on or for Linux specifically platform-macos platform-windows Building on or for Windows specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants