-
Notifications
You must be signed in to change notification settings - Fork 6k
[macOS] Remove a single accessibility root assumption #40316
Conversation
@@ -187,9 +187,7 @@ | |||
if (ax_node.data().HasState(ax::mojom::State::kEditable)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chunhtai Do you know a widget that exercises this scenario? This scenario can only be reached by nodes with the kEditable
state that don't have the kTextField
role.
The logic to create AXNode
s only gives the kEditable
state to semantic nodes with the kFlutterSemanticsFlagIsTextField
flag but not the kFlutterSemanticsFlagIsReadOnly
flag. However, such a semantics node would have the kTextField
role. In other words, it seems this code is unreachable. Please let me know if I misunderstood something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there documentation in the ax::mojo::State
enum for this role?
The ax::mojo::State
enum is defined as strictly powers of two? i.e. there's no state kFoo
that happens to be kBar | kEditable
I assume? Agreed that at first glance, it certainly looks like this is probably dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these are defined as enum class
so the answer appears to be that at least today, this is unused code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh just to make sure it's clear: semantic nodes have both state
bit flags and a role
enum. These are separate :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied code from chromium, I don't think flutter have such widget that would run this code. We may in the future though, and we would need to update the common a11y_bridge to support that, but I am ok if we delete this code path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. I'll leave it in for now given we may have such a widget in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Probably need opinions from people who are more familiar. Also, shouldn't you mark it Ready For Review? |
// can query semantics information from. | ||
engine.semanticsEnabled = YES; | ||
auto bridge = std::reinterpret_pointer_cast<AccessibilityBridgeMacSpy>( | ||
viewController.accessibilityBridge.lock()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#40334 ... you saw nothing 🤫
I had left this as a draft due to this comment above that might affect this pull request substantially. I'll mark it as ready for now though :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
248e83c
to
5484f89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -187,9 +187,7 @@ | |||
if (ax_node.data().HasState(ax::mojom::State::kEditable)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied code from chromium, I don't think flutter have such widget that would run this code. We may in the future though, and we would need to update the common a11y_bridge to support that, but I am ok if we delete this code path.
…122942) * e6334f166 [web] Remove image codecs from Canvaskit Chromium (flutter/engine#40309) * 56727d62c Revert "[Impeller] mark decoded images as optimized for GPU access (#40356)" (flutter/engine#40387) * 2cd19e3d1 Wrap the iOS platform message handler in an autorelease pool block (flutter/engine#40373) * bab7853ad Update analyzer for api_conform_test (flutter/engine#40386) * 87b2e82d1 Roll Fuchsia Mac SDK from z32cF6YFs6CvZbY3g... to 4ZrEK2uzGdp_Gz3DU... (flutter/engine#40385) * fc57995fe Ignore some MTLCompiler failures in impeller unit tests (flutter/engine#40391) * 2398c5222 Add doc comment to Pipeline (flutter/engine#40388) * f585d4bc5 [macOS] Remove a single accessibility root assumption (flutter/engine#40316) * 940cf3c98 remove temporary flag and make FlutterTest the default font for real (flutter/engine#40352) * a1bf9fd2a drawTextBlob should not be compatible with opacity inheritance (flutter/engine#40396) * 55bf0d85e Use bundled analyzer everywhere (flutter/engine#40398) * 8e580414a Roll Skia from 9bfb45d3e065 to 49b902e5fb91 (11 revisions) (flutter/engine#40397) * 77c53d25e Default the CanvasKit base URL to local artifacts. (flutter/engine#40293) * 625ea5395 Roll Skia from 49b902e5fb91 to aa983f5486f0 (7 revisions) (flutter/engine#40404) * 867679fac [Impeller] Add playground flag to render for a specific amount of time. (flutter/engine#40377) * d74169608 [Impeller] Remove unused bounds method from typographer interface (flutter/engine#40406) * 941323d77 Provisional iOS impeller flag flip (flutter/engine#40405) * bb971ab55 Revert "Default the CanvasKit base URL to local artifacts. (#40293)" (flutter/engine#40415)
Today, the root accessibility semantics node is guaranteed to have ID 0. In a multi-window world, each view will have its own semantics tree, but semantic node IDs will be globally unique. In other words, the semantics tree's root will no longer be guaranteed to have ID 0. As a result,
AccessibilityBridge::kRootNodeId
is deprecated and all uses should be removed.Part of flutter/flutter#119391
Manual test
Manual test...
Apply the framework patch below, run an app using your local engine, and verify the accessibility works as expected:
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.