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

Clarify dispatch semantics action id parameter #38356

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Dec 16, 2022

Previously, the embedder API incorrectly documented this as an action ID, but it's actually the semantics node ID. This fixes the docs and renames the parameter to clarify its purpose.

This callback is registered in the framework render bindings:
https://github.com/flutter/flutter/blob/9102f2fe0bd26db6074ac4a17785296cd341ecb9/packages/flutter/lib/src/rendering/binding.dart#L43

Handled by _handleSemanticsAction:
https://github.com/flutter/flutter/blob/9102f2fe0bd26db6074ac4a17785296cd341ecb9/packages/flutter/lib/src/rendering/binding.dart#L360-L366

Which invokes SemanticsOwner.performAction, where the node is looked up by ID:
https://github.com/flutter/flutter/blob/9102f2fe0bd26db6074ac4a17785296cd341ecb9/packages/flutter/lib/src/semantics/semantics.dart#L3258-L3277

farside

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.

@cbracken cbracken requested a review from goderbauer December 16, 2022 18:51
@flutter-dashboard flutter-dashboard bot added the embedder Related to the embedder API label Dec 16, 2022
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Hixie
Copy link
Contributor

Hixie commented Dec 16, 2022

test-exempt: code refactor with no semantic change

@cbracken cbracken changed the title Clarify semantics action dispatch id parameter Clarify dispatch semantics action id parameter Dec 16, 2022
Copy link
Contributor

@justinmc justinmc 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 cleaning up the naming!

+1 for use of The Far Side.

Previously the embedder API documented this as an action ID, but it's
actually the semantics node ID. This fixes the docs and renames the
parameter to clarify its purpose.
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you!

@cbracken cbracken merged commit 1fe1ec4 into flutter:main Dec 16, 2022
@cbracken cbracken deleted the semantics-node-id branch December 16, 2022 21:40
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 16, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 17, 2022
…117246)

* 1fe1ec414 Clarify semantics action dispatch id parameter (flutter/engine#38356)

* 985f4ac51 Ensure licenses excluded file list has newline at EOF (flutter/engine#38354)

* 4097c333f Update documentation to use `--local-web-sdk` flags. (flutter/engine#38328)

* 60cf34e2a Remove DisplayList's dependency on SkAutoTMalloc (flutter/engine#38359)
loic-sharma pushed a commit to loic-sharma/flutter-engine that referenced this pull request Jan 3, 2023
Previously the embedder API documented this as an action ID, but it's
actually the semantics node ID. This fixes the docs and renames the
parameter to clarify its purpose.

This callback is registered in the framework render bindings:
https://github.com/flutter/flutter/blob/9102f2fe0bd26db6074ac4a17785296cd341ecb9/packages/flutter/lib/src/rendering/binding.dart#L43

Handled by `_handleSemanticsAction`:
https://github.com/flutter/flutter/blob/9102f2fe0bd26db6074ac4a17785296cd341ecb9/packages/flutter/lib/src/rendering/binding.dart#L360-L366

Which invokes `SemanticsOwner.performAction`, where the node is looked up by ID:
https://github.com/flutter/flutter/blob/9102f2fe0bd26db6074ac4a17785296cd341ecb9/packages/flutter/lib/src/semantics/semantics.dart#L3258-L3277
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#117246)

* 1fe1ec414 Clarify semantics action dispatch id parameter (flutter/engine#38356)

* 985f4ac51 Ensure licenses excluded file list has newline at EOF (flutter/engine#38354)

* 4097c333f Update documentation to use `--local-web-sdk` flags. (flutter/engine#38328)

* 60cf34e2a Remove DisplayList's dependency on SkAutoTMalloc (flutter/engine#38359)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
embedder Related to the embedder API needs tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants