DescriptionImplement nameFromLabelElement to see if a control is associated with a label.
In a few places in the code, we have an HTML control and a label element,
and we want to know if that label is providing the name for that control.
It seems clean to call axObject.name() and check the returned nameFrom,
but computing the whole name has side effects (creating AXObjects of
descendants) so it caused a crash. Instead, nameFromLabelElement is simpler
and computes just what's needed.
This unfortunately duplicates a small amount of logic. I added comments to
hopefully avoid introducing more errors in the future.
BUG=558689
Committed: https://crrev.com/183bda8ea817bee6edd0589d02c611fc09fb9cee
Cr-Commit-Position: refs/heads/master@{#361395}
Patch Set 1 #
Depends on Patchset: Messages
Total messages: 11 (4 generated)
|