Commit 3d4e31d5 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Use parent-relative coordinates in AXTreeSourceAura

Convert the global coordinates reported by each AXAuraObjWrapper into
parent-relative coordinates to be used in the accessibility tree. That
way when any Window, Widget, or View moves (and fires a location
changed event), its descendants all move relative to it by default.

Bug: 761164
Change-Id: I19eae6f1ca5f00726107aca764d537d776cc16f3
Reviewed-on: https://chromium-review.googlesource.com/780362Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518450}
parent 915ae8f5
......@@ -108,6 +108,19 @@ void AXTreeSourceAura::SerializeNode(AXAuraObjWrapper* node,
ui::AXNodeData* out_data) const {
node->Serialize(out_data);
// Convert the global coordinates reported by each AXAuraObjWrapper
// into parent-relative coordinates to be used in the accessibility
// tree. That way when any Window, Widget, or View moves (and fires
// a location changed event), its descendants all move relative to
// it by default.
AXAuraObjWrapper* parent = node->GetParent();
if (parent) {
ui::AXNodeData parent_data;
parent->Serialize(&parent_data);
out_data->location.Offset(-parent_data.location.OffsetFromOrigin());
out_data->offset_container_id = parent->GetID();
}
if (out_data->role == ui::AX_ROLE_WEB_VIEW) {
views::View* view = static_cast<views::AXViewObjWrapper*>(node)->view();
content::WebContents* contents =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment