Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d218b70
initial draft for accessible name using caption role
jongund Jul 22, 2019
f78b02a
updated defintion of caption labelling technique to account for neste…
jongund Aug 1, 2019
91e7dab
Merge branch 'master' into issue1019-accname-from-caption
jongund Aug 1, 2019
383ddc4
updated defintion of caption labelling technique to account for neste…
jongund Aug 1, 2019
12ba4f7
updated table role authoring guidance
jongund Aug 1, 2019
fb4ed46
added gird to elements that can be labeledusing caption
jongund Aug 1, 2019
da11b44
fixed formatting bug
jongund Aug 1, 2019
b2e14d7
updated the authoring practices for table and grid
jongund Aug 1, 2019
110c2e9
updated table and grid authoring guidance
jongund Aug 1, 2019
54b53bc
updated name from caption based on disucssion for name from heading
jongund Aug 1, 2019
39b5889
modfied to include first or last child element for caption
jongund Aug 1, 2019
318902e
fixed description bug
jongund Aug 1, 2019
905a3cd
made caption and legend synonyms
jongund Sep 9, 2019
0fe80d3
fixed misspelled word
jongund Oct 3, 2019
3489acb
Merge branch 'master' into issue1019-accname-from-caption
jongund Oct 10, 2019
03549f6
removed reference to any pointer or touch behavior for the caption or…
jongund Oct 10, 2019
2f3aa27
made suggested change to table role authoring practices
jongund Oct 10, 2019
cda33c1
updated authoring practices for figure role
jongund Oct 10, 2019
764d631
updated to say in some cases for last child
jongund Oct 10, 2019
692220c
harmonized lanaguage for visible label authoring for figure, grid and…
jongund Oct 10, 2019
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
58 changes: 34 additions & 24 deletions common/script/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
})
;
}

}
;
var s = "var roleInfo = " + JSON.stringify(roleInfo, null, '\t') ;
Expand Down Expand Up @@ -173,11 +173,11 @@ require(["core/pubsubhub"], function( respecEvents ) {
var abstract = container.querySelector("." + type + "-applicability");
if ((abstract.textContent || abstract.innerText) === "All elements of the base markup") {
globalSP.push({ is: type, title: title, name: content, desc: desc, prohibited: false });
}
}
else if ((abstract.textContent || abstract.innerText) === "All elements of the base markup except for some roles or elements that prohibit its use") {
globalSP.push({ is: type, title: title, name: content, desc: desc, prohibited: true });
}
}

// the rdef is gone. if we are in a div, convert that div to a section

if (container.nodeName.toLowerCase() == "div") {
Expand All @@ -192,7 +192,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
container.parentNode.replaceChild(sec, container) ;
}
});

if (!skipIndex) {
// we have all the properties and states - spit out the
// index
Expand Down Expand Up @@ -266,7 +266,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
var fromAuthor = "";
var fromContent = "";
var fromEncapsulation = "";
var fromLegend = "";
var fromCaption = "";
var fromProhibited = "";

$.each(document.querySelectorAll("rdef"), function(i,item) {
Expand Down Expand Up @@ -317,7 +317,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
parentRoles.push(s);
});
}
// are there supported states / properties in this role?
// are there supported states / properties in this role?
var attrs = [];
$.each(container.querySelectorAll(".role-properties, .role-required-properties, .role-disallowed"), function(i, node) {
if (node && ((node.textContent && node.textContent.length !== 1) || (node.innerText && node.innerText.length !== 1))) {
Expand All @@ -330,8 +330,8 @@ require(["core/pubsubhub"], function( respecEvents ) {
var type = (item.localName === "pref" ? "property" : "state");
var req = $(node).hasClass("role-required-properties");
var dis = $(node).hasClass("role-disallowed");
attrs.push( { is: type, name: name, required: req, disallowed: dis } );
attrs.push( { is: type, name: name, required: req, disallowed: dis } );

// remember that the state or property is
// referenced by this role
propList[name].roles.push(title);
Expand All @@ -351,19 +351,19 @@ require(["core/pubsubhub"], function( respecEvents ) {

if (node.textContent.indexOf("author") !== -1) {
fromAuthor += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
}
}
if (!isAbstract && node.textContent.indexOf("content") !== -1) {
fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>";
}
if (node.textContent.indexOf("prohibited") !== -1) {
fromProhibited += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
}
if (node.textContent.indexOf("encapsulation") !== -1) {
fromEncapsulation += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
fromEncapsulation += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
}
if ((node.textContent.indexOf("caption") !== -1) || (node.textContent.indexOf("legend") !== -1)) {
fromCaption += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
}
if (node.textContent.indexOf("legend") !== -1) {
fromLegend += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
}
});
}
if (container.nodeName.toLowerCase() == "div") {
Expand Down Expand Up @@ -396,7 +396,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
return myList;
}
};

if (!skipIndex) {
// build up the complete inherited SP lists for each role
// however, if the role already specifies an item, do not include it
Expand Down Expand Up @@ -445,7 +445,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
}
}
});

// Update state and property role references
var getAllSubRoles = function(role) {
var ref = subRoles[role];
Expand All @@ -464,7 +464,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
return [];
}
};

$.each(propList, function(i, item) {
var output = "";
var section = document.querySelector("#" + item.name);
Expand Down Expand Up @@ -511,7 +511,7 @@ require(["core/pubsubhub"], function( respecEvents ) {
}
}
});

// spit out the index
var node = document.getElementById("index_role");
var parentNode = node.parentNode;
Expand Down Expand Up @@ -552,13 +552,23 @@ require(["core/pubsubhub"], function( respecEvents ) {
parentNode.replaceChild(list, node);
}

node = document.getElementById("index_fromlegend");
node = document.getElementById("index_fromcontent");
if (node) {
parentNode = node.parentNode;
list = document.createElement("ul");
list.id = "index_fromlegend";
list.className = "compact";
list.innerHTML = fromLegend;
list.innerHTML = fromContent;
parentNode.replaceChild(list, node);
}

node = document.getElementById("index_fromcaption");
if (node) {
parentNode = node.parentNode;
list = document.createElement("ul");
list.id = "index_fromcaption";
list.className = "compact";
list.innerHTML = fromCaption;
parentNode.replaceChild(list, node);
}

Expand Down Expand Up @@ -593,15 +603,15 @@ require(["core/pubsubhub"], function( respecEvents ) {
}

// prune out unused rows throughout the document

$.each(document.querySelectorAll(".role-abstract, .role-parent, .role-base, .role-related, .role-scope, .role-mustcontain, .role-required-properties, .role-properties, .role-namefrom, .role-namerequired, .role-namerequired-inherited, .role-childpresentational, .role-presentational-inherited, .state-related, .property-related,.role-inherited, .role-children, .property-descendants, .state-descendants, .implicit-values"), function(i, item) {
var content = $(item).text();
if (content.length === 1 || content.length === 0) {
// there is no item - remove the row
item.parentNode.remove();
} else if (content === "Placeholder"
&& !skipIndex
&& (item.className === "role-inherited"
} else if (content === "Placeholder"
&& !skipIndex
&& (item.className === "role-inherited"
|| item.className === "role-children"
|| item.className === "property-descendants"
|| item.className === "state-descendants" )) {
Expand Down
Loading