Skip to content

Commit

Permalink
Report aria-label and aria-description even when parent has no visibl…
Browse files Browse the repository at this point in the history
…e children (nvaccess#16471)

Fixes nvaccess#14514

Summary of the issue:
HTML figure elements with no accessible children (EG, all children set to aria-hidden=true) but with an aria-label or aria-description are not reported by NVDA.

Description of user facing changes
Elements with no accessible children but which have a label or description are now reported in browse mode. Note this only applies to elements which are still rendered; if all children are set to display: none, for example, NVDA still does not report the parent element.

Description of development approach
Render a single space in elements with no content but a label or description se
  • Loading branch information
SaschaCowley authored and Luke Davis committed May 10, 2024
1 parent b9a45ec commit 4288300
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,11 +1262,13 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
parentNode->isBlock=false;
}

if ((isInteractive || role == ROLE_SYSTEM_SEPARATOR) && parentNode->getLength() == 0) {
if ((isInteractive || role == ROLE_SYSTEM_SEPARATOR || name || description.has_value()) && parentNode->getLength() == 0) {
// If the node is interactive or otherwise relevant even when empty
// and it still has no content, render a space so the user can access the node.
previousNode = buffer->addTextFieldNode(parentNode, previousNode, EMPTY_TEXT_NODE);
if(previousNode&&!locale.empty()) previousNode->addAttribute(L"language",locale);
if (previousNode && !locale.empty()) {
previousNode->addAttribute(L"language", locale);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Changes

* The fallback braille input table is now equal to the fallback output table, which is Unified English Braille Code grade 1. (#9863, @JulienCochuyt, @LeonarddeR)
* NVDA will now report figures with no accessible children, but with a label or description. (#14514)
* When reading by line in browse mode, "caption" is no longer reported on each line of a long figure or table caption. (#14874)

### Bug Fixes
Expand Down

0 comments on commit 4288300

Please sign in to comment.