Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal refactors, CI, or test-only changes.
- `Document` accessibility role: a browser page or embedded web view (AT-SPI `document web`/`document frame`, `AXWebArea`, Android `WebView`, UIA `Document` from a web engine) now reads as a `Document` whose children are the page's elements, on Linux, Windows, macOS and Android.

### Fixed
- `glass_set_value` no longer reports that a desktop accessibility write "did not take" when the element exposes a writable value but no readable value for confirmation. Linux, macOS and Windows now report the write as unconfirmed and steer the caller to re-snapshot instead of retrying a write that may already have landed.
- A web view whose content the platform has not published is disclosed in the snapshot instead of arriving as an indistinguishable empty group: a childless `Document` is named by id and bounds and steers to a re-snapshot before pixels, while a placeholder the app published for content it withheld steers straight to pixels.
- On Linux, `glass_set_value` now confirms a write actually landed instead of trusting the AT-SPI toolkit's own acknowledgment of it, the way the Windows and macOS readers already did: it reads the element back (polling briefly, since the toolkit applies the write on a later main-loop pass), and an element that acknowledges a write without applying it — as web content can — now reports that instead of a silent false success.
- On Linux, the container of an `<iframe>` inside a browser page no longer reads as a `Window`: AT-SPI's `internal frame`, which the web engines publish for an embedded frame and no desktop toolkit uses, now maps to `Group`, so a `role:"Window"` selector matches the app's real windows again instead of frames inside a page. The nested `Document` inside such a frame is unchanged.
Expand Down
11 changes: 8 additions & 3 deletions crates/glass-a11y-linux/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,18 @@ fn write_verdict(
observed: Option<&str>,
) -> GlassError {
match observed {
None => GlassError::AxWriteUnconfirmed(
id,
"the element exposes a writable value but no readable value was available after the write"
.into(),
),
Some(seen) if write_took_no_effect(seen, before) => GlassError::value_not_applied_because(
id,
requested,
Some(seen),
ACKNOWLEDGED_NOT_APPLIED,
),
seen => GlassError::value_not_applied(id, requested, seen),
Some(seen) => GlassError::value_not_applied(id, requested, Some(seen)),
}
}

Expand Down Expand Up @@ -930,8 +935,8 @@ mod tests {
);
let unread = write_verdict(3, "typed", Some("old"), None);
assert!(
matches!(unread, GlassError::AxValueNotApplied { why: None, .. }),
"a read-back that failed is no evidence about the write; got: {unread:?}"
matches!(unread, GlassError::AxWriteUnconfirmed(3, _)),
"a read-back that failed cannot prove the write was rejected; got: {unread:?}"
);
}

Expand Down
9 changes: 8 additions & 1 deletion crates/glass-a11y-macos/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ impl Accessibility for MacosA11y {
// A read that failed, or one showing a value the element reformatted, is not
// evidence of a projection that accepted the write and kept its value.
return Err(match after.as_deref() {
None => GlassError::AxWriteUnconfirmed(
target.id.0,
"the element exposes a writable value but no readable value was available after the write"
.into(),
),
Some(seen) if write_took_no_effect(seen, before.as_deref()) => {
GlassError::value_not_applied_because(
target.id.0,
Expand All @@ -164,7 +169,9 @@ impl Accessibility for MacosA11y {
READ_ONLY_PROJECTION,
)
}
seen => GlassError::value_not_applied(target.id.0, text, seen),
Some(seen) => {
GlassError::value_not_applied(target.id.0, text, Some(seen))
}
});
}
std::thread::sleep(Duration::from_millis(SET_VALUE_POLL_MS));
Expand Down
7 changes: 6 additions & 1 deletion crates/glass-a11y-windows/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ fn run_set_value(ctx: &AxContext, target: &AxTarget, text: &str) -> Result<()> {
// A read that failed, or one showing a value the element reformatted, is not evidence
// of a projection that accepted the write and kept its value.
return Err(match after.as_deref() {
None => GlassError::AxWriteUnconfirmed(
target.id.0,
"the element exposes a writable value but no readable value was available after the write"
.into(),
),
Some(seen) if write_took_no_effect(seen, before.as_deref()) => {
GlassError::value_not_applied_because(
target.id.0,
Expand All @@ -418,7 +423,7 @@ fn run_set_value(ctx: &AxContext, target: &AxTarget, text: &str) -> Result<()> {
READ_ONLY_PROJECTION,
)
}
seen => GlassError::value_not_applied(target.id.0, text, seen),
Some(seen) => GlassError::value_not_applied(target.id.0, text, Some(seen)),
});
}
std::thread::sleep(Duration::from_millis(VERIFY_POLL_MS));
Expand Down