fix: Base AT-SPI ENABLED/SENSITIVE states on the disabled flag - #787
Closed
dylanpulver wants to merge 1 commit into
Closed
fix: Base AT-SPI ENABLED/SENSITIVE states on the disabled flag#787dylanpulver wants to merge 1 commit into
dylanpulver wants to merge 1 commit into
Conversation
STATE_ENABLED and STATE_SENSITIVE were set by the else arm of the read-only branch, so they never consulted `is_disabled`. For any role that doesn't support aria-readonly, a disabled node was exposed as enabled and sensitive; conversely a read-only-but-enabled control lost both states. Core-AAM 1.2 maps aria-disabled=true to "STATE_ENABLED not exposed" and aria-disabled=false to STATE_ENABLED, and its aria-readonly=true row withdraws only STATE_EDITABLE. The other four adapters already derive the platform enabled state from `is_disabled`.
Member
|
Closing in favor of #788. Please @dylanpulver next time consider opening an issue instead of submitting such contribution. Thanks. |
Author
|
Understood, and noted for next time — I'll open an issue first here rather than arriving with a patch. Glad the fix landed in #788. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NodeWrapper::statecomputedSTATE_ENABLEDandSTATE_SENSITIVEin theelsearm of the read-only branch (adapters/atspi-common/src/node.rs:376-380), so neither ever consultedis_disabled. Measured on cleanmainby callingstate()directly:So a disabled node whose role doesn't support
aria-readonly(Button,Link,MenuItem,Tab, ...) is indistinguishable from the enabled one, and a read-only-but-enabled control loses both states.Core-AAM 1.2 §3.5.2.27 maps
aria-disabled="true"to ATK/AT-SPI "State:STATE_ENABLEDnot exposed" and §3.5.2.28 mapsaria-disabled="false"toSTATE_ENABLED; thearia-readonly="true"row (§3.5.2.77) withdraws onlySTATE_EDITABLE. The other four adapters already derive the platform enabled state fromis_disabled—macos/src/node.rs:660,windows/src/node.rs:535,android/src/node.rs:35,ios/src/node.rs:144— and #474 was that same change for macOS.The fix leaves the read-only branch exactly as it was and gates
Enabled | Sensitiveon!is_disabled(). Behaviour changes in the two cells above and nowhere else.cargo +1.85 test -p accesskit_atspi_common(the MSRV toolchain CI uses): 7 passed on cleanmain, 11 passed here, 13 with--all-features.cargo fmt --all -- --check,cargo clippy -p accesskit_atspi_common --all-features --all-targets -- -D warningsandcargo docwithRUSTDOCFLAGS=-D warningsall clean locally.The new tests discriminate: reverting the source alone fails 2 of the 4; the narrower
} else if !state.is_disabled() {still fails the read-only one; dropping the read-only branch instead fails bothREAD_ONLYassertions.enabled_node_is_enabled_and_sensitivepasses in every one of those trees.Not tested: I have no Linux machine or Orca here, so this is verified at the
accesskit_atspi_commontranslation layer only, not end to end throughaccesskit_unixagainst a live AT.This change was prepared with AI assistance (Claude Opus 5).