Skip to content

Commit c67d0e2

Browse files
committed
Updated the AccName algorithm code to remove figcaption from the naming computation as recently decided by the ARIA WG.
1 parent ce27e34 commit c67d0e2

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Accessible Name Computation Prototype
77
To ensure interoperability, the W3C Alternative Text Computation must be supported in all browsers equally.
88

99
The AccName Prototype mirrors the development of the W3C AccName specification, which will be updated accordingly with all expected behaviors as this development continues within the W3C ARIA Working Group.
10-
http://www.w3.org/TR/accname-aam-1.1/
10+
https://w3c.github.io/accname/
1111

1212
Live AccName Prototype Test Page
1313
https://whatsock.github.io/w3c-alternative-text-computation/Editable%20Live%20Input%20AccName%20Test.html

docs/Sample JavaScript Recursion Algorithm/recursion.js

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
CalcNames: The AccName Computation Prototype, compute the Name and Description property values for a DOM node
33
Returns an object with 'name' and 'desc' properties.
44
Functionality mirrors the steps within the W3C Accessible Name and Description computation algorithm.
5-
http://www.w3.org/TR/accname-aam-1.1/
6-
Authored by Bryan Garaventa, plus refactoring contrabutions by Tobias Bengfort
5+
https://w3c.github.io/accname/
6+
Author: Bryan Garaventa
77
https://github.com/whatsock/w3c-alternative-text-computation
88
Distributed under the terms of the Open Source Initiative OSI - MIT License
99
*/
@@ -14,7 +14,7 @@ Distributed under the terms of the Open Source Initiative OSI - MIT License
1414
window[nameSpace] = {};
1515
nameSpace = window[nameSpace];
1616
}
17-
nameSpace.getAccNameVersion = "2.56";
17+
nameSpace.getAccNameVersion = "2.57";
1818
// AccName Computation Prototype
1919
nameSpace.getAccName = nameSpace.calcNames = function(
2020
node,
@@ -683,32 +683,6 @@ Plus roles extended for the Role Parity project.
683683
skip = true;
684684
}
685685

686-
var isFigure =
687-
!skipTo.tag &&
688-
!skipTo.role &&
689-
!hasName &&
690-
(nRole === "figure" || (!nRole && nTag === "figure"));
691-
692-
// Otherwise, if name is still empty and is a standard figure element with a non-empty associated figcaption element as the first or last child node, process caption with same naming computation algorithm.
693-
// Plus do the same for role="figure" with embedded role="caption", or a combination of these.
694-
if (isFigure) {
695-
fChild =
696-
firstChild(node, ["figcaption"], ["caption"]) ||
697-
lastChild(node, ["figcaption"], ["caption"]) ||
698-
false;
699-
if (fChild) {
700-
name = trim(
701-
walk(fChild, stop, false, [], false, {
702-
ref: ownedBy,
703-
top: fChild
704-
}).name
705-
);
706-
}
707-
if (trim(name)) {
708-
hasName = true;
709-
}
710-
}
711-
712686
// Otherwise, if name is still empty and the root node and the current node are the same and node is an svg element, then parse the content of the title element to set the name and the desc element to set the description.
713687
if (!skipTo.tag && !skipTo.role && nTag === "svg") {
714688
var svgT = node.querySelector("title") || false;

0 commit comments

Comments
 (0)