Set heading semantics for Flag.IS_HEADER#179681
Set heading semantics for Flag.IS_HEADER#179681JJdeGroot wants to merge 1 commit intoflutter:masterfrom
Flag.IS_HEADER#179681Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request addresses a regression in heading semantics by restoring support for the Flag.IS_HEADER. The change correctly uses a logical OR to consider both Flag.IS_HEADER and headingLevel > 0 for determining if a node is a heading, ensuring backward compatibility. A new test case is also added to verify the behavior of Flag.IS_HEADER, preventing future regressions. The changes are correct, and the added test is well-written and provides good coverage for the fix.
| // Heading support | ||
| if (Build.VERSION.SDK_INT >= API_LEVELS.API_28) { | ||
| result.setHeading(semanticsNode.headingLevel > 0); | ||
| result.setHeading(semanticsNode.hasFlag(Flag.IS_HEADER) || semanticsNode.headingLevel > 0); |
There was a problem hiding this comment.
It seems like #175416 explicitly meant to remove the need for Flag.IS_HEADER. Can you clarify the case where that fallback is needed?
There was a problem hiding this comment.
Right, the header doesn't translate to the heading in android, that is the reason for original change
|
Closing as not planned. |
Fixes broken heading semantics, due to a breaking change in #175416
This PR adds backwards compatibility for setting header semantics by taking both
Flag.IS_HEADERandheadingLevelinto account.It also adds a test for Flag.IS_HEADER to prevent future breaking changes.
Fixes: #179678
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.