mirror of
https://github.com/servo/servo
synced 2026-05-09 00:22:16 +02:00
in #42336, we added a [Servo](https://doc.servo.org/servo/struct.Servo.html)-global API for controlling whether accessibility is active. the idea was that when the embedder activates accessibility, all webviews and documents activate accessibility and start sending AccessKit tree updates, and vice versa when they deactivate. we found a problem with this approach in #42338. global activation of accessibility makes it too easy to accidentally cause a panic in AccessKit, and harder than it needs to be for embedders to learn that they are responsible for grafting each webview’s subtree into their main AccessKit tree as soon as accessibility is activated. this is due to an invariant of the AccessKit subtree API: if a subtree starts sending updates before the graft node is created, the program panics. this patch reworks accessibility activation to make it per-webview. by requiring embedders to explicitly activate accessibility for a webview, we can communicate the AccessKit invariant via our API docs. Testing: this patch includes an initial accessibility test in libservo Fixes: part of #4344, extracted from our work in #42338 --------- Signed-off-by: Alice Boxhall <alice@igalia.com> Signed-off-by: delan azabani <dazabani@igalia.com> Co-authored-by: Alice Boxhall <alice@igalia.com>