fix(aria-required-children): do not fail for children with aria-hidden#3949
fix(aria-required-children): do not fail for children with aria-hidden#3949
Conversation
| export { default as isOpaque } from './is-opaque'; | ||
| export { default as isSkipLink } from './is-skip-link'; | ||
| export { default as isVisibleToScreenReaders } from './is-visible-for-screenreader'; | ||
| export { default as isVisibleToScreenReaders } from './is-visible-to-screenreader'; |
There was a problem hiding this comment.
I noticed that the file names were still using for instead of to so changed those to match the name of the function while I was there.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const ownedElements = getOwnedVirtual(virtualNode); | ||
| for (let i = 0; i < ownedElements.length; i++) { | ||
| const ownedElement = ownedElements[i]; | ||
| if (ownedElement.props.nodeType !== 1) { |
There was a problem hiding this comment.
Needed to ignore non-element nodes as isVisibletoScreenreaders calls into isHiddenForEveryone which tries to get the computed style for display, which fails for non-element nodes
WilcoFiers
left a comment
There was a problem hiding this comment.
LGTM. If you haven't already, can you look if this same problem may need to be fixed on the list and definition-list rules? Separate issue if so.
<ul>
<div aria-hidden="true">foo</div>
<li>bar</li>
</ul>passes the <dl>
<span aria-hidden="true">foo</span>
<dt>bar</dt>
<dd>baz</dd>
</dl>passes the |
|
Has this fix been released? I upgraded axe-core to 4.7.2 and I still the issue. Please let me know. |
|
@ilantom This should have been fixed in 4.7.1 I believe. Could you provide a code sample of it failing? It was validated for the original issue #3850 (comment). |
|
Is your site public that I could take a look at it? Running axe-core on the microsoft page itself still does not show a violation for |
Implementação da correção do falso positivo em aria-required-children quando elementos filhos têm aria-hidden="true". Problema: - Elementos com aria-hidden="true" estavam causando falhas - Estes elementos não fazem parte da árvore de acessibilidade - O check verificava atributos ARIA globais mas não visibilidade Solução aplicada: 1. Importar isVisibleToScreenReaders() de commons/dom 2. Adicionar check para nodeType !== 1 (ignorar nós de texto) Arquivo modificado: lib/checks/aria/aria-required-children-evaluate.js Comparação com solução oficial (PR dequelabs#3949): ✅ LÓGICA IDÊNTICA - 95% similar - Mesmas verificações e mesma ordem - Adicionei comentários explicativos (melhor documentação) - Solução oficial: 9 arquivos (renomeação + testes) - Minha solução: 1 arquivo (core fix apenas) A diferença principal está no escopo: - Oficial renomeou is-visible-for-screenreaders → is-visible-to-screenreader - Oficial atualizou todos os imports (9 arquivos) - Oficial adicionou 217 linhas de testes Análise completa em: ANALISE-ISSUE-3850.md Referências: - Issue: dequelabs#3850 - PR oficial: dequelabs#3949 - ACT Rule: https://www.w3.org/WAI/standards-guidelines/act/rules/ff89c9/proposed/ - Commit oficial: 8714d6b


Closes: #3850