-
Nektarios Paisios authored
This is required before merging BrowserAccessibilityPosition and AXNodePosition. In UI Automation, we expose an "embedded object replacement character" \xFFFC in the text representation of all empty controls, so that they will be treated by AXPosition as word, character and line boundaries. This patch moves some of the logic for determining which node is an empty control to AXNode in the form of the AXNode::IsEmptyLeaf method. Note that the definition of a control is quite loose and it encompasses all leaf nodes that expose no inner text or hypertext. This is in order to cover all possible future additions to our rendering engine and in order to extend this behavior to possibly other elements which meet the same criteria. This behavior is not new, but it has been moved from AXPosition::IsEmptyLeaf. This patch also fixes AXNode::IsLeaf to properly mark ignored nodes that have children as not leaves. A leaf node should be, either a node with no children (including ignored and unignored), or any unignored node whose entire subtree is not exposed to platform APIs. Ignored nodes that are already in an ignored subtree, should not be marked as leaves too, otherwise AXPosition::AsLeafTextPosition() might stop unexpectedly while traversing the AX tree to find a leaf node: ++kTextField "Some Text" (leaf node) ++++kGenericContainer ignored (should not be marked as a leaf node) ++++++kStaticText "Some text" ++++++++kInlineTextBox "Some text" (leaf node) For optimal performance AXNode::GetInnerTextLength() is introduced and is used by AXNode::IsEmptyLeaf(). Concadenating strings is much slower than adding up their lengths. Finally, AXNode::GetHypertext() is fixed so that descendants of leaf nodes have the correct hypertext per the existing IA2 and ATK behavior. R=dmazzoni@chromium.org, aleventhal@chromium.org AX-Relnotes: n/a. Bug: 1049261 Change-Id: I4ea5b578dded79920f07bf6a66df208dd4a88fae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2637515Reviewed-by:
Kurt Catti-Schmidt <kschmi@microsoft.com> Reviewed-by:
Dominic Mazzoni <dmazzoni@chromium.org> Commit-Queue: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#845782}
19d3bcf5