Skip to content

Commit

Permalink
namefrom-heading script additions blocking w3c/aria#1860
Browse files Browse the repository at this point in the history
  • Loading branch information
cookiecrook committed Feb 16, 2023
1 parent b1219af commit 504ff11
Showing 1 changed file with 13 additions and 34 deletions.
47 changes: 13 additions & 34 deletions script/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,8 @@ function ariaAttributeReferences() {
var subRoles = [];
var roleIndex = '';
var fromAuthor = '';
var fromHeading = "";
var fromContent = '';
var fromEncapsulation = '';
var fromLegend = '';
var fromProhibited = '';

Array.prototype.slice
Expand Down Expand Up @@ -358,8 +357,8 @@ function ariaAttributeReferences() {
req +
'</li>';
}
if (!isAbstract && node.textContent.indexOf('content') !== -1) {
fromContent +=
if (node.textContent.indexOf('heading') !== -1) {
fromHeading +=
'<li><a href="#' +
pnID +
'" class="role-reference"><code>' +
Expand All @@ -368,18 +367,8 @@ function ariaAttributeReferences() {
req +
'</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 +=
if (!isAbstract && node.textContent.indexOf('content') !== -1) {
fromContent +=
'<li><a href="#' +
pnID +
'" class="role-reference"><code>' +
Expand All @@ -388,8 +377,8 @@ function ariaAttributeReferences() {
req +
'</li>';
}
if (node.textContent.indexOf('legend') !== -1) {
fromLegend +=
if (node.textContent.indexOf('prohibited') !== -1) {
fromProhibited +=
'<li><a href="#' +
pnID +
'" class="role-reference"><code>' +
Expand Down Expand Up @@ -677,33 +666,23 @@ function ariaAttributeReferences() {
parentNode.replaceChild(list, node);
}

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

node = document.getElementById('index_fromencapsulation');
node = document.getElementById('index_fromheading');
if (node) {
parentNode = node.parentNode;
list = document.createElement('ul');
list.id = 'index_fromencapsulation';
list.id = 'index_fromheading';
list.className = 'compact';
list.innerHTML = fromEncapsulation;
list.innerHTML = fromHeading;
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.id = 'index_fromcontent';
list.className = 'compact';
list.innerHTML = fromLegend;
list.innerHTML = fromContent;
parentNode.replaceChild(list, node);
}

Expand Down

0 comments on commit 504ff11

Please sign in to comment.