• Hiroki Sato's avatar
    Fix ARC a11y bounds computation · a11f636a
    Hiroki Sato authored
    AXRelativeBounds assumes that the bounds are relative to the root of the
    tree by default, but in ARC, every nodes' bounds are computed relative
    to its container.
    
    AutomationInternalCustomBindings::ComputeGlobalNodeBounds computes the
    bounds by first calling AXTree::RelativeToTreeBoundsInternal to compute
    the node's relative bounds to its root using AXRelativeBounds, and then
    applying the difference between the root and the container.
    
    In Dialog or Popup window, the root node can have some amount of offset
    to its container. As a result, every computed bounds in such window
    has "doubled" offset to ARC container.
    
    This CL fixes the computation.
    
    This CL also simplifies geometry_util in arc a11y because
    exo::WMHelper::GetInstance() never returns nullptr.
    
    Bug: b:145260260
    Test: manual. With TalkBack-test app, Alerts window has correct bounds.
    Change-Id: I93033ad0b2771828cdf00d17d1ebe039ef1d7044
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2061930
    Commit-Queue: Hiroki Sato <hirokisato@chromium.org>
    Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
    Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#743386}
    a11f636a
geometry_util.cc 1.5 KB