AX: Hidden nodes which are not directly referenced should not participate name/descri...
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 May 2018 00:06:49 +0000 (00:06 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 May 2018 00:06:49 +0000 (00:06 +0000)
commitc9195b066637717b1c1e03adc83553c3bd906896
treef21990e9b95309a582a9d1e272a7c304f4cf97dd
parent6aeab8e5fce069b90d4cc31419006fd91a42add0
AX: Hidden nodes which are not directly referenced should not participate name/description from content
https://bugs.webkit.org/show_bug.cgi?id=185478

Reviewed by Chris Fleizach.

Source/WebCore:

Add a check to AccessibilityNodeObject::textUnderElement() and return early
if the node is hidden, not referenced by aria-labelledby or aria-describedby,
not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement.

Test: accessibility/text-alternative-calculation-hidden-nodes.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):

LayoutTests:

* accessibility/text-alternative-calculation-hidden-nodes-expected.txt: Added.
* accessibility/text-alternative-calculation-hidden-nodes.html: Added.
* platform/gtk/accessibility/text-alternative-calculation-hidden-nodes-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/text-alternative-calculation-hidden-nodes-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/text-alternative-calculation-hidden-nodes.html [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/text-alternative-calculation-hidden-nodes-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp