Fix some issues with clickables on some websites.
This commit is contained in:
1 parent
d0c977281d
commit
20578ada40
7 files changed
+304
-2
No files matched your search
@@ -139,6 +139,16 @@ func (adapter *Adapter) native_actions(ctx context.Context, object ObjectID, exp
|
||||
C.g_error_free(nativeErr)
|
||||
return ActionSet{}, errors.New("accessible action failed")
|
||||
}
|
||||
// Actions can reveal document branches without a children-changed
|
||||
// event. Refresh the same ancestry as browse-caret activation so
|
||||
// the next navigation discovers the newly opened options.
|
||||
adapter.treeMutex.Lock()
|
||||
tree := adapter.documentTree
|
||||
adapter.treeMutex.Unlock()
|
||||
if tree != nil {
|
||||
adapter.treeInvalidations.Add(uint64(tree.markAncestorChildrenChanged(object)))
|
||||
adapter.treeInvalidations.Add(uint64(tree.InvalidateSnapshot(object)))
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
labelRaw := C.atspi_action_get_localized_name(action, C.gint(index), nil)
|
||||
|
||||
@@ -269,6 +269,10 @@ func (adapter *Adapter) activateNativeDocumentObject(ctx context.Context, positi
|
||||
}
|
||||
if activated != 0 {
|
||||
adapter.treeInvalidations.Add(uint64(tree.markAncestorChildrenChanged(position.ID())))
|
||||
// Caret navigation tolerates stale child order on ticking pages.
|
||||
// A completed action must instead refresh before leaving its
|
||||
// target, or it can skip a newly revealed popup entirely.
|
||||
adapter.treeInvalidations.Add(uint64(tree.InvalidateSnapshot(position.ID())))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -551,15 +555,21 @@ func (adapter *Adapter) setNativeDocumentPosition(ctx context.Context, position
|
||||
for _, id := range echoIDs {
|
||||
adapter.navigationEcho[id] = 15
|
||||
}
|
||||
text := C.atspi_accessible_get_text_iface(source)
|
||||
component := C.atspi_accessible_get_component_iface(source)
|
||||
if component != nil {
|
||||
if documentTargetGrabsFocus(tree, position, snapshot) {
|
||||
C.atspi_component_grab_focus(component, nil)
|
||||
}
|
||||
C.atspi_component_scroll_to(component, C.ATSPI_SCROLL_ANYWHERE, nil)
|
||||
// Setting a text caret reveals its range. An additional whole-object
|
||||
// scroll can move the outer document while reading a popup's inner
|
||||
// scroller, causing the page to dismiss the popup. Python likewise
|
||||
// relies on caret placement for text; non-text stops still need scroll.
|
||||
if text == nil {
|
||||
C.atspi_component_scroll_to(component, C.ATSPI_SCROLL_ANYWHERE, nil)
|
||||
}
|
||||
C.g_object_unref(C.gpointer(component))
|
||||
}
|
||||
text := C.atspi_accessible_get_text_iface(source)
|
||||
if text == nil {
|
||||
clear(adapter.navigationEcho)
|
||||
// Images and other whole-object stops have a valid virtual position
|
||||
|
||||
Reference in new issue
Block a user