Skip to content
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

Set and unset accessibility flags even when re-entrant #6853

Merged
merged 4 commits into from
Nov 14, 2018

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Nov 14, 2018

Using ^= was toggling these instead of setting them when they're enabled - this caused part of what is noted in flutter/flutter#20388, but I'd like to leave that bug open even if this lands - I suspect that we should be resetting some internal state of the a11y bridges that we're not, but need to confirm.

/cc @matthew-carroll in case this impacts the embedding refactor

@dnfield
Copy link
Contributor Author

dnfield commented Nov 14, 2018

Took a quick look at the iOS side and noticed a similar issue - these methods can be called where enabled is true both times for a given feature, so we should avoid using XOR.

@dnfield dnfield changed the title Or instead of Xor Set and unset accessibility flags even when re-entrant Nov 14, 2018
Copy link
Member

@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

flags ^= static_cast<int32_t>(blink::AccessibilityFeatureFlag::kReduceMotion);
if (UIAccessibilityIsBoldTextEnabled())
flags ^= static_cast<int32_t>(blink::AccessibilityFeatureFlag::kBoldText);
if (UIAccessibilityIsInvertColorsEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

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

This is unnecessary, flags is built up from 0 every time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh I missed that. I'm still inclined to change these all to |= as we don't actually want these to toggle, we just want to set them. Sound good to you?

Copy link
Member

Choose a reason for hiding this comment

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

SGTM

@dnfield dnfield merged commit 114d33d into flutter:master Nov 14, 2018
@dnfield dnfield deleted the android_a11y_bits branch November 14, 2018 07:54
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Nov 14, 2018
flutter/engine@b10b8e8...114d33d

git log b10b8e8..114d33d --no-merges --oneline
114d33d Set and unset accessibility flags even when re-entrant (flutter/engine#6853)
396402f Flush UserSettings to window (flutter/engine#6850)
1e7e676 Remove unused import (flutter/engine#6854)


The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants