• Jacques Newman's avatar
    Reland "Expose visibility-hidden elements" · 0dae0ab0
    Jacques Newman authored
    
    This was reverted here:
    https://chromium-review.googlesource.com/c/chromium/src/+/1692384
    due to failure on failure on linux-chromeos-rel
    ChromeVoxPanelTest.LinkMenu
    
    As of https://chromium-review.googlesource.com/c/chromium/src/+/1708415
    This test no longer fails.
    
    Original CL:
    https://chromium-review.googlesource.com/c/chromium/src/+/1646877
    
    Original Change description:
    > Expose visibility-hidden elements
    >
    > This change allows visibility-hidden elements to be returned from
    > UIA_DescribedByPropertyId and UIA_LabeledByPropertyId. To allow for
    > this, visibility-hidden elements had to be exposed to the AX tree.
    > This change can be observed in the update to
    > AXObject::ComputeAccessibilityIsIgnoredPassThrough().
    >
    > Given:
    > <div id="a" aria-label="foo" style="visibility:hidden"> </div>
    > <div id="b" aria-labelled-by="a"> </div>
    >
    > When doing TextAlternative calculation for b, we know we are
    > "in_aria_labelled_by_traversal", therefore we do not check to see
    > if the node "IsHiddenForTextAlternativeCalculation", therefore
    > correctly calculating the name for node "b".
    > But, when we are doing TextAlternative calculation for node "a",
    > we do not know if node "a" is the target of aria-labelledby, and
    > is not considered to be "in_aria_labelled_by_traversal", so the
    > name is an empty string: "".
    > This is an issue, as the UIA_LabeledByPropertyId on node "b"
    > returns node "a", and node "a" has an incorrect name of empty
    > string.
    >
    > For purposes of computing a non-recursive text alternative,
    > if an ignored and IsHiddenForTextAlternativeCalculation node
    > is included in the tree, assume that it is the target of
    > aria-labelledby or aria-describedby, since we can't tell
    > yet whether that's the case. If it isn't exposed, the AT
    > will never see the name anyways.
    >
    > This new behavior is only applied when calculating the
    > TextAlternative for the ignored node directly, not in the
    > recursive case. This ensures this new behavior is only applied
    > to the ignored node, and does not influence the name calculation
    > of other nodes.
    
    Bug: 651614
    Change-Id: I6ec57cbd36606890eaf1fd4e72d8442cae2442ad
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730851Reviewed-by: default avatarKevin Babbitt <kbabbitt@microsoft.com>
    Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
    Commit-Queue: Jacques Newman <janewman@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#683439}
    0dae0ab0
hidden-expected-uia-win.txt 43 Bytes