Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions guided-navigation/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] – 2026-10-02

### Added

- Fixtures for `aria-labelledby` pointing to `hidden` and `aria-hidden` elements

### Fixed

- `aria-labelledby` now uses the elements it references even when they are hidden (`hidden` or `aria-hidden="true"`), as AccName requires, instead of ignoring them

## [1.0.0] – 2026-10-01

### Added
Expand Down
3 changes: 2 additions & 1 deletion guided-navigation/fixtures/ROLES_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ renaming, or removing a fixture.
| Role | Fixtures |
| --- | --- |
| `abstract` | `abstract-epub-type`, `abstract-role-aria` |
| `accessible-name` | `accessible-name-labelledby-aria-hidden`, `accessible-name-labelledby-hidden-attribute` |
| `acknowledgments` | `acknowledgments-epub-type`, `acknowledgments-role-aria` |
| `afterword` | `afterword-epub-type`, `afterword-role-aria` |
| `appendix` | `appendix-epub-type`, `appendix-role-aria` |
Expand Down Expand Up @@ -77,4 +78,4 @@ renaming, or removing a fixture.
| `toc` | `toc-epub-type`, `toc-role-aria` |
| `video` | `video-html-native`, `video-no-description` |

178 fixtures across 69 roles.
180 fixtures across 70 roles.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"children": [
{
"role": [
"paragraph"
],
"text": {
"language": "en",
"plain": "Into speech.",
"ssml": "Into speech. <readium:link id=\"link1\" />"
},
"children": [
{
"id": "link1",
"textref": "#gloss",
"text": {
"plain": "see glossary entry"
}
}
]
},
{
"role": [
"paragraph"
],
"text": {
"plain": "synthesized speech can be created."
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>Into speech. <a href="#gloss" aria-labelledby="lbl">*</a></p>
<p>synthesized speech can be created.</p>
<span id="lbl" aria-hidden="true">see glossary entry</span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "accessible-name-labelledby-aria-hidden",
"description": "A link named via aria-labelledby pointing at an element marked aria-hidden=\"true\": the hidden label still names the link, and is not emitted on its own",
"role": "accessible-name",
"rolesCovered": [
"paragraph"
],
"sourceRef": "https://www.w3.org/TR/accname/#computation-steps",
"inputKind": "fragment"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"children": [
{
"role": [
"paragraph"
],
"text": {
"language": "en",
"plain": "Into speech.",
"ssml": "Into speech. <readium:link id=\"link1\" />"
},
"children": [
{
"id": "link1",
"textref": "#gloss",
"text": {
"plain": "see glossary entry"
}
}
]
},
{
"role": [
"paragraph"
],
"text": {
"plain": "synthesized speech can be created."
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>Into speech. <a href="#gloss" aria-labelledby="lbl">*</a></p>
<p>synthesized speech can be created.</p>
<span id="lbl" hidden>see glossary entry</span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "accessible-name-labelledby-hidden-attribute",
"description": "A link named via aria-labelledby pointing at an element hidden with the native hidden attribute: the hidden label still names the link, and is not emitted on its own",
"role": "accessible-name",
"rolesCovered": [
"paragraph"
],
"sourceRef": "https://www.w3.org/TR/accname/#computation-steps",
"inputKind": "fragment"
}
20 changes: 20 additions & 0 deletions guided-navigation/fixtures/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@
"gnd": "gnd.json"
}
},
{
"id": "accessible-name-labelledby-aria-hidden",
"dir": "accessible-name-labelledby-aria-hidden",
"role": "accessible-name",
"description": "A link named via aria-labelledby pointing at an element marked aria-hidden=\"true\": the hidden label still names the link, and is not emitted on its own",
"files": {
"input": "input.html",
"gnd": "gnd.json"
}
},
{
"id": "accessible-name-labelledby-hidden-attribute",
"dir": "accessible-name-labelledby-hidden-attribute",
"role": "accessible-name",
"description": "A link named via aria-labelledby pointing at an element hidden with the native hidden attribute: the hidden label still names the link, and is not emitted on its own",
"files": {
"input": "input.html",
"gnd": "gnd.json"
}
},
{
"id": "acknowledgments-epub-type",
"dir": "acknowledgments-epub-type",
Expand Down
2 changes: 1 addition & 1 deletion guided-navigation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@readium/guided-navigation",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "Guided Navigation document generation from HTML and XHTML content",
"author": "readium",
Expand Down
2 changes: 1 addition & 1 deletion guided-navigation/src/a11y.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export function extractNodeAria(el: Element): [string | null, boolean] {

if (labelNodes.length > 0) {
let text = "";
// Directly-referenced label nodes count even when hidden (AccName 2.A).
labelNodes.forEach((n, i) => {
if (nodeIsHidden(n)) return;
const label = n.getAttribute("aria-label");
text += label ? label : nodeTextExcludingExplicitRoles(n);
if (i < labelNodes.length - 1) text += " ";
Expand Down
Loading