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

Hide a11y elements when resigning active #29566

Merged
merged 4 commits into from Nov 6, 2021
Merged

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Nov 5, 2021

Fixes flutter/flutter#93030

When we resign active, we should hide the a11y elements.

We should probably use the same mechanism for when we launch a modal dialog, but refactoring those tests is a little painful right now (I tried to do it twice while working on this today only to find that there was some failure I hadn't accounted for). I'd like to get this fixed and we can look into fixing that in a separate PR.

/cc @chunhtai @gaaclarke fyi

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

I'd prefer we not expose more methods implementations in that FlutterViewController(Tests) category, so hopefully it works posting the notifications from the test.

But if not, we're already exposing quite a few of them now, so in for a penny in for a pound.

The actual code change LGTM, thanks for finding something so simple.

FlutterViewController* realVC = [[FlutterViewController alloc] initWithEngine:engine
nibName:nil
bundle:nil];
XCTAssertFalse(realVC.view.accessibilityElementsHidden, @"");
Copy link
Member

Choose a reason for hiding this comment

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

Posting the notifications directly instead of exposing the applicationWillResignActive: applicationBecameActive: API in the test worked for me:

  XCTAssertFalse(realVC.view.accessibilityElementsHidden);
  [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationWillResignActiveNotification object:nil];
  XCTAssertTrue(realVC.view.accessibilityElementsHidden);
  [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:nil];
  XCTAssertFalse(realVC.view.accessibilityElementsHidden);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with this. I think I was somehow not rebuilding the target correctly when I got failures on this locally. It's not failing now.

dnfield and others added 2 commits November 5, 2021 16:58
@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Nov 6, 2021
@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Linux Fuchsia has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Nov 6, 2021
@dnfield
Copy link
Contributor Author

dnfield commented Nov 6, 2021

Why is this change even running Fuchsia tests on presubmit? It's only changing darwin related code. @godofredoc @CaseyHillers ?

@dnfield dnfield merged commit 0be0303 into flutter:master Nov 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2021
@dnfield dnfield deleted the ios_a11y branch November 8, 2021 00:07
@CaseyHillers
Copy link
Contributor

Why is this change even running Fuchsia tests on presubmit? It's only changing darwin related code. @godofredoc @CaseyHillers ?

Because the Fuchsia builds don't have any runif logic in the ci.yaml. If you're familiar with their codebase, feel free to add some runif statements and I'll happily approve them (to track I filed flutter/flutter#93261)

zanderso pushed a commit to flutter/flutter that referenced this pull request Nov 8, 2021
* 422b15a Roll Skia from d9d9e21b311c to a8d38078a4f3 (1 revision) (flutter/engine#29521)

* afe1c98 Roll Fuchsia Mac SDK from SfdmlzXiU... to nkHhPcy3q... (flutter/engine#29522)

* b7f4651 Roll Fuchsia Linux SDK from 5-RB9TzQH... to m90mMA37b... (flutter/engine#29523)

* 15d5a23 [Web] Fix BMP encoder (flutter/engine#29448)

* 3f55aec Fix FlutterPresentInfo struct_size doc string (flutter/engine#29524)

* b991af9 Roll Skia from a8d38078a4f3 to 7368c6d00b7c (5 revisions) (flutter/engine#29525)

* 93666e2 Fix isolate_configuration typo (flutter/engine#29318)

* 91033b9 Roll Skia from 7368c6d00b7c to a5030e9090e8 (3 revisions) (flutter/engine#29527)

* c2090c2 [iOS] Make sure spawnee's isGpuDisabled is set correctly when FlutterEngine spawn (flutter/engine#29361)

* e071f1d Roll Skia from a5030e9090e8 to 37afdbc22e89 (4 revisions) (flutter/engine#29528)

* ca1710a Roll Skia from 37afdbc22e89 to a05d3029ac65 (4 revisions) (flutter/engine#29532)

* 3364409 Reland Display Features support (Foldable and Cutout) (flutter/engine#29447)

* 4684d23 [fuchsia] Add more logging for error cases. (flutter/engine#29397)

* 5cf7c39 Remove D3D9 fallback path (flutter/engine#29533)

* 98d31de [raster_cache] Increment access_count on Touch (flutter/engine#29529)

* cc6fc4a Re-enable A11yTreeIsConsistent with higher timeout (flutter/engine#29367)

* fb20916 Roll Skia from a05d3029ac65 to 37da672b14b7 (1 revision) (flutter/engine#29534)

* d229ec8 use SkMatrix.invert() instead of MatrixDecomposition to validate cache matrices (flutter/engine#29530)

* a92aebb Roll Clang Linux from 5N9a1nYj5... to UtjvZhwws... (flutter/engine#29535)

* 47dab8a Roll Dart SDK from 3b11f88c96a5 to f38618d5d0c0 (7 revisions) (flutter/engine#29537)

* 83ccad7 FragmentProgram constructed asynchronously (flutter/engine#29513)

* 2078baf Roll Fuchsia Linux SDK from m90mMA37b... to Ci-Vji1rx... (flutter/engine#29546)

* 6bf8093 Roll Fuchsia Mac SDK from nkHhPcy3q... to emi7COLIo... (flutter/engine#29547)

* 290d179 Roll Skia from 37da672b14b7 to cf8daf79e710 (9 revisions) (flutter/engine#29548)

* 197ca59 [iOS] Fixes press key message leaks (flutter/engine#29354)

* 986b8d8 Roll Skia from cf8daf79e710 to ae67f07a58a2 (1 revision) (flutter/engine#29549)

* 11010f0 Roll Skia from ae67f07a58a2 to 17616469ddf8 (1 revision) (flutter/engine#29551)

* dadc7b2 Roll Skia from 17616469ddf8 to 4322c7fec7e4 (3 revisions) (flutter/engine#29552)

* ed66091 don't build flutter SDK artifacts for armv7 (flutter/engine#28016)

* 484cc5c Roll Dart SDK from f38618d5d0c0 to 05febe0a7860 (5 revisions) (flutter/engine#29539)

* 387563a Roll Skia from 4322c7fec7e4 to 1800d410df16 (1 revision) (flutter/engine#29553)

* 05ceba2 Roll Skia from 1800d410df16 to 725705f6630b (1 revision) (flutter/engine#29555)

* 2b142ef Roll Dart SDK from 05febe0a7860 to 38e7078fa2b7 (5 revisions) (flutter/engine#29556)

* 29da91f Roll Fuchsia Linux SDK from Ci-Vji1rx... to kHXT3xnTG... (flutter/engine#29557)

* da02a4b Roll Fuchsia Mac SDK from emi7COLIo... to 6BYh8qaYo... (flutter/engine#29558)

* 71fb575 Roll Skia from 725705f6630b to deb9386be146 (3 revisions) (flutter/engine#29559)

* c5f572a [Linux keyboard] Fix logical keys of up events are not regularized (flutter/engine#29550)

* 988ea43 Roll Dart SDK from 38e7078fa2b7 to d464cd3f2dc8 (5 revisions) (flutter/engine#29561)

* fdee74d Trace calls to Canvas::saveLayer (flutter/engine#29444)

* 953f718 ios test script checks for `ios_test_flutter` artifacts (flutter/engine#29554)

* 145d890 Roll Skia from deb9386be146 to 37bef2d300e4 (6 revisions) (flutter/engine#29563)

* cc9b174 Fix race condition introduced by background platform channels (flutter/engine#29377)

* 79b5e3c Roll Dart SDK from d464cd3f2dc8 to 996ef242a2c9 (1 revision) (flutter/engine#29564)

* 3eb6e15 fuchsia: Enable integration tests (flutter/engine#29565)

* ffa8b25 Roll Skia from 37bef2d300e4 to 2417872a9993 (1 revision) (flutter/engine#29567)

* 9af2de9 Roll Dart SDK from 996ef242a2c9 to 5ccf755b37a4 (1 revision) (flutter/engine#29568)

* 16d6d18 Roll Fuchsia Linux SDK from kHXT3xnTG... to uP2kJIngK... (flutter/engine#29569)

* 321bc56 Roll Fuchsia Mac SDK from 6BYh8qaYo... to W9UXc2Fwx... (flutter/engine#29570)

* f0a8d4e Roll Dart SDK from 5ccf755b37a4 to f6a43e5eb71d (1 revision) (flutter/engine#29571)

* 0be0303 Hide a11y elements when resigning active (flutter/engine#29566)

* 9a3195a Roll Fuchsia Linux SDK from uP2kJIngK... to aD3d4Kqmy... (flutter/engine#29572)

* b3cbee5 Roll Fuchsia Mac SDK from W9UXc2Fwx... to rIpW1050J... (flutter/engine#29573)

* df686d2 Revert "Reland Display Features support (Foldable and Cutout) (#29447)" (flutter/engine#29574)

* e812731 Revert dart to 38e7078fa2b7 (flutter/engine#29575)

* 049074e Roll Skia from 2417872a9993 to cd7220e7686c (2 revisions) (flutter/engine#29577)

* e6a51a4 Roll Fuchsia Mac SDK from rIpW1050J... to TOmxgL3av... (flutter/engine#29578)

* 8f272d9 Roll Fuchsia Linux SDK from aD3d4Kqmy... to ZniYyCw7U... (flutter/engine#29579)

* 469d6f1 Revert "[Web] Fix BMP encoder (#29448)" (flutter/engine#29580)
WizzXu pushed a commit to WizzXu/flutter that referenced this pull request Nov 19, 2021
* 422b15a Roll Skia from d9d9e21b311c to a8d38078a4f3 (1 revision) (flutter/engine#29521)

* afe1c98 Roll Fuchsia Mac SDK from SfdmlzXiU... to nkHhPcy3q... (flutter/engine#29522)

* b7f4651 Roll Fuchsia Linux SDK from 5-RB9TzQH... to m90mMA37b... (flutter/engine#29523)

* 15d5a23 [Web] Fix BMP encoder (flutter/engine#29448)

* 3f55aec Fix FlutterPresentInfo struct_size doc string (flutter/engine#29524)

* b991af9 Roll Skia from a8d38078a4f3 to 7368c6d00b7c (5 revisions) (flutter/engine#29525)

* 93666e2 Fix isolate_configuration typo (flutter/engine#29318)

* 91033b9 Roll Skia from 7368c6d00b7c to a5030e9090e8 (3 revisions) (flutter/engine#29527)

* c2090c2 [iOS] Make sure spawnee's isGpuDisabled is set correctly when FlutterEngine spawn (flutter/engine#29361)

* e071f1d Roll Skia from a5030e9090e8 to 37afdbc22e89 (4 revisions) (flutter/engine#29528)

* ca1710a Roll Skia from 37afdbc22e89 to a05d3029ac65 (4 revisions) (flutter/engine#29532)

* 3364409 Reland Display Features support (Foldable and Cutout) (flutter/engine#29447)

* 4684d23 [fuchsia] Add more logging for error cases. (flutter/engine#29397)

* 5cf7c39 Remove D3D9 fallback path (flutter/engine#29533)

* 98d31de [raster_cache] Increment access_count on Touch (flutter/engine#29529)

* cc6fc4a Re-enable A11yTreeIsConsistent with higher timeout (flutter/engine#29367)

* fb20916 Roll Skia from a05d3029ac65 to 37da672b14b7 (1 revision) (flutter/engine#29534)

* d229ec8 use SkMatrix.invert() instead of MatrixDecomposition to validate cache matrices (flutter/engine#29530)

* a92aebb Roll Clang Linux from 5N9a1nYj5... to UtjvZhwws... (flutter/engine#29535)

* 47dab8a Roll Dart SDK from 3b11f88c96a5 to f38618d5d0c0 (7 revisions) (flutter/engine#29537)

* 83ccad7 FragmentProgram constructed asynchronously (flutter/engine#29513)

* 2078baf Roll Fuchsia Linux SDK from m90mMA37b... to Ci-Vji1rx... (flutter/engine#29546)

* 6bf8093 Roll Fuchsia Mac SDK from nkHhPcy3q... to emi7COLIo... (flutter/engine#29547)

* 290d179 Roll Skia from 37da672b14b7 to cf8daf79e710 (9 revisions) (flutter/engine#29548)

* 197ca59 [iOS] Fixes press key message leaks (flutter/engine#29354)

* 986b8d8 Roll Skia from cf8daf79e710 to ae67f07a58a2 (1 revision) (flutter/engine#29549)

* 11010f0 Roll Skia from ae67f07a58a2 to 17616469ddf8 (1 revision) (flutter/engine#29551)

* dadc7b2 Roll Skia from 17616469ddf8 to 4322c7fec7e4 (3 revisions) (flutter/engine#29552)

* ed66091 don't build flutter SDK artifacts for armv7 (flutter/engine#28016)

* 484cc5c Roll Dart SDK from f38618d5d0c0 to 05febe0a7860 (5 revisions) (flutter/engine#29539)

* 387563a Roll Skia from 4322c7fec7e4 to 1800d410df16 (1 revision) (flutter/engine#29553)

* 05ceba2 Roll Skia from 1800d410df16 to 725705f6630b (1 revision) (flutter/engine#29555)

* 2b142ef Roll Dart SDK from 05febe0a7860 to 38e7078fa2b7 (5 revisions) (flutter/engine#29556)

* 29da91f Roll Fuchsia Linux SDK from Ci-Vji1rx... to kHXT3xnTG... (flutter/engine#29557)

* da02a4b Roll Fuchsia Mac SDK from emi7COLIo... to 6BYh8qaYo... (flutter/engine#29558)

* 71fb575 Roll Skia from 725705f6630b to deb9386be146 (3 revisions) (flutter/engine#29559)

* c5f572a [Linux keyboard] Fix logical keys of up events are not regularized (flutter/engine#29550)

* 988ea43 Roll Dart SDK from 38e7078fa2b7 to d464cd3f2dc8 (5 revisions) (flutter/engine#29561)

* fdee74d Trace calls to Canvas::saveLayer (flutter/engine#29444)

* 953f718 ios test script checks for `ios_test_flutter` artifacts (flutter/engine#29554)

* 145d890 Roll Skia from deb9386be146 to 37bef2d300e4 (6 revisions) (flutter/engine#29563)

* cc9b174 Fix race condition introduced by background platform channels (flutter/engine#29377)

* 79b5e3c Roll Dart SDK from d464cd3f2dc8 to 996ef242a2c9 (1 revision) (flutter/engine#29564)

* 3eb6e15 fuchsia: Enable integration tests (flutter/engine#29565)

* ffa8b25 Roll Skia from 37bef2d300e4 to 2417872a9993 (1 revision) (flutter/engine#29567)

* 9af2de9 Roll Dart SDK from 996ef242a2c9 to 5ccf755b37a4 (1 revision) (flutter/engine#29568)

* 16d6d18 Roll Fuchsia Linux SDK from kHXT3xnTG... to uP2kJIngK... (flutter/engine#29569)

* 321bc56 Roll Fuchsia Mac SDK from 6BYh8qaYo... to W9UXc2Fwx... (flutter/engine#29570)

* f0a8d4e Roll Dart SDK from 5ccf755b37a4 to f6a43e5eb71d (1 revision) (flutter/engine#29571)

* 0be0303 Hide a11y elements when resigning active (flutter/engine#29566)

* 9a3195a Roll Fuchsia Linux SDK from uP2kJIngK... to aD3d4Kqmy... (flutter/engine#29572)

* b3cbee5 Roll Fuchsia Mac SDK from W9UXc2Fwx... to rIpW1050J... (flutter/engine#29573)

* df686d2 Revert "Reland Display Features support (Foldable and Cutout) (flutter#29447)" (flutter/engine#29574)

* e812731 Revert dart to 38e7078fa2b7 (flutter/engine#29575)

* 049074e Roll Skia from 2417872a9993 to cd7220e7686c (2 revisions) (flutter/engine#29577)

* e6a51a4 Roll Fuchsia Mac SDK from rIpW1050J... to TOmxgL3av... (flutter/engine#29578)

* 8f272d9 Roll Fuchsia Linux SDK from aD3d4Kqmy... to ZniYyCw7U... (flutter/engine#29579)

* 469d6f1 Revert "[Web] Fix BMP encoder (flutter#29448)" (flutter/engine#29580)
yx-mike added a commit to yx-mike/engine that referenced this pull request Jan 12, 2022
yx-mike added a commit to yx-mike/engine that referenced this pull request Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants