mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 785144 - Braille doesn't update when navigating through content. r=blassey r=eeejay
This commit is contained in:
parent
81556ffce5
commit
30e43428af
@ -162,6 +162,18 @@ public class GeckoAccessibility {
|
||||
sVirtualCursorNode.setEnabled(message.optBoolean("enabled", true));
|
||||
sVirtualCursorNode.setChecked(message.optBoolean("checked"));
|
||||
sVirtualCursorNode.setPassword(message.optBoolean("password"));
|
||||
|
||||
final JSONArray textArray = message.optJSONArray("text");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (textArray != null && textArray.length() > 0) {
|
||||
sb.append(textArray.optString(0));
|
||||
for (int i = 1; i < textArray.length(); i++) {
|
||||
sb.append(" ").append(textArray.optString(i));
|
||||
}
|
||||
}
|
||||
sVirtualCursorNode.setText(sb.toString());
|
||||
sVirtualCursorNode.setContentDescription(message.optString("description"));
|
||||
|
||||
JSONObject bounds = message.optJSONObject("bounds");
|
||||
if (bounds != null) {
|
||||
Rect relativeBounds = new Rect(bounds.optInt("left"), bounds.optInt("top"),
|
||||
@ -223,13 +235,14 @@ public class GeckoAccessibility {
|
||||
@Override
|
||||
public void onPopulateAccessibilityEvent (View host, AccessibilityEvent event) {
|
||||
super.onPopulateAccessibilityEvent(host, event);
|
||||
if (sEventMessage != null)
|
||||
if (sEventMessage != null) {
|
||||
populateEventFromJSON(event, sEventMessage);
|
||||
// No matter where the a11y focus is requested, we always force it back to the current vc position.
|
||||
event.setSource(host, VIRTUAL_CURSOR_POSITION);
|
||||
}
|
||||
// We save the hover enter event so that we could reuse it for a subsequent accessibility focus event.
|
||||
if (event.getEventType() != AccessibilityEvent.TYPE_VIEW_HOVER_ENTER)
|
||||
sEventMessage = null;
|
||||
// No matter where the a11y focus is requested, we always force it back to the current vc position.
|
||||
event.setSource(host, VIRTUAL_CURSOR_POSITION);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user