Commit 24842000 authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Chromium LUCI CQ

Added comments clarifying some details of AXNode::IsEmptyLeaf and IsLeaf

TBR=aleventhal@chromium.org

Change-Id: I5d188d9751d9436992053981e99c0054bd44f89f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644892Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846438}
parent af4c535d
...@@ -1286,13 +1286,15 @@ bool AXNode::IsEmptyLeaf() const { ...@@ -1286,13 +1286,15 @@ bool AXNode::IsEmptyLeaf() const {
} }
bool AXNode::IsLeaf() const { bool AXNode::IsLeaf() const {
// A node is a leaf if it has no descendants, regardless whether it is ignored // A node is a leaf if it has no descendants, i.e. if it is at the bottom of
// or not. // the tree, regardless whether it is ignored or not.
if (children().empty()) if (children().empty())
return true; return true;
// Leaf nodes with descendants should always be exposed to the platforms' // Ignored nodes with any kind of descendants, (ignored or unignored), cannot
// accessibility layer. // be leaves because: A) If some of their descendants are unignored then those
// descendants need to be exposed to the platform layer, and B) If all of
// their descendants are ignored they are still not at the bottom of the tree.
if (IsIgnored()) if (IsIgnored())
return false; return false;
......
...@@ -486,6 +486,12 @@ class AX_EXPORT AXNode final { ...@@ -486,6 +486,12 @@ class AX_EXPORT AXNode final {
// that, ignored nodes (leaf or otherwise) do not expose their inner text or // that, ignored nodes (leaf or otherwise) do not expose their inner text or
// hypertext to the platforms' accessibility layer, but they expose the inner // hypertext to the platforms' accessibility layer, but they expose the inner
// text or hypertext of their unignored descendants. // text or hypertext of their unignored descendants.
//
// For example, empty text fields might have a set of unignored nested divs
// inside them:
// ++kTextField
// ++++kGenericContainer
// ++++++kGenericContainer
bool IsEmptyLeaf() const; bool IsEmptyLeaf() const;
// Returns true if this is a leaf node, meaning all its // Returns true if this is a leaf node, meaning all its
......
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