Skip to content

Commit 07b7c8c

Browse files
halindromejoanmarie
authored andcommitted
Fixed some namefrom issues.
Spec had some mis-formatted namefrom blocks. Script was processing namefrom even on abstract roles.
1 parent 0894831 commit 07b7c8c

File tree

2 files changed

+25
-35
lines changed

2 files changed

+25
-35
lines changed

aria/aria.html

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,7 @@ <h2>Definition of Roles</h2>
24362436
</tr>
24372437
<tr>
24382438
<th class="role-properties-head" scope="row">Supported States and Properties:</th>
2439-
<td class="role-properties">&#160;</td>
2439+
<td class="role-properties"> </td>
24402440
</tr>
24412441
<tr>
24422442
<th class="role-inherited-head" scope="row">Inherited States and Properties:</th>
@@ -2448,7 +2448,7 @@ <h2>Definition of Roles</h2>
24482448
</tr>
24492449
<tr>
24502450
<th class="role-namerequired-head" scope="row">Accessible Name Required:</th>
2451-
<td class="role-namerequired">&#160;</td>
2451+
<td class="role-namerequired"> </td>
24522452
</tr>
24532453
<tr>
24542454
<th class="role-namerequired-inherited-head" scope="row">Inherits Name Required:</th>
@@ -3670,11 +3670,7 @@ <h2>Definition of Roles</h2>
36703670
</tr>
36713671
<tr>
36723672
<th class="role-namefrom-head" scope="row">Name From:</th>
3673-
<td class="role-namefrom">
3674-
<ul>
3675-
<li>author</li>
3676-
</ul>
3677-
</td>
3673+
<td class="role-namefrom">author</td>
36783674
</tr>
36793675
<tr>
36803676
<th class="role-namerequired-head" scope="row">Accessible Name Required:</th>
@@ -4812,11 +4808,7 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
48124808
</tr>
48134809
<tr>
48144810
<th class="role-namefrom-head" scope="row">Name From:</th>
4815-
<td class="role-namefrom">
4816-
<ul>
4817-
<li>author (if role discarded by error conditions)</li>
4818-
</ul>
4819-
</td>
4811+
<td class="role-namefrom">author (if role discarded by error conditions)</td>
48204812
</tr>
48214813
<tr>
48224814
<th class="role-namerequired-head" scope="row">Accessible Name Required:</th>
@@ -6989,11 +6981,7 @@ <h5 id="role-presentation-ednote-none">Editorial Note regarding the ARIA 1.1 <rr
69896981
</tr>
69906982
<tr>
69916983
<th class="role-namefrom-head" scope="row">Name From:</th>
6992-
<td class="role-namefrom">
6993-
<ul>
6994-
<li>author</li>
6995-
</ul>
6996-
</td>
6984+
<td class="role-namefrom">author</td>
69976985
</tr>
69986986
<tr>
69996987
<th class="role-namerequired-head" scope="row">Accessible Name Required:</th>

aria/script/aria.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -333,30 +333,32 @@ require(["core/pubsubhub"], function( respecEvents ) {
333333
roleInfo[title] = { "name": title, "fragID": pnID, "parentRoles": parentRoles, "localprops": attrs };
334334
// is there a namefrom indication? If so, add this one to
335335
// the list
336-
$.each(container.querySelectorAll(".role-namefrom"), function(i, node) {
337-
var reqRef = container.querySelector(".role-namerequired");
338-
var req = "";
339-
if (reqRef && reqRef.innerText === "True") {
340-
req = " (name required)";
341-
}
342-
343-
if ($(node).find("li").length) {
344-
// there is a list; put it in both lists
345-
fromAuthor += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
346-
if (!isAbstract) {
347-
fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>";
336+
if (!isAbstract) {
337+
$.each(container.querySelectorAll(".role-namefrom"), function(i, node) {
338+
var reqRef = container.querySelector(".role-namerequired");
339+
var req = "";
340+
if (reqRef && reqRef.innerText === "True") {
341+
req = " (name required)";
348342
}
349-
} else {
350-
// it is a text node; use that
351-
if (node.textContent.indexOf("author") !== -1) {
343+
344+
if ($(node).find("li").length) {
345+
// there is a list; put it in both lists
352346
fromAuthor += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
353-
} else if (node.textContent.indexOf("content") !== -1) {
354347
if (!isAbstract) {
355348
fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>";
356349
}
350+
} else {
351+
// it is a text node; use that
352+
if (node.textContent.indexOf("author") !== -1) {
353+
fromAuthor += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + req + "</li>";
354+
} else if (node.textContent.indexOf("content") !== -1) {
355+
if (!isAbstract) {
356+
fromContent += "<li><a href=\"#" + pnID + "\" class=\"role-reference\"><code>" + content + "</code></a>" + "</li>";
357+
}
358+
}
357359
}
358-
}
359-
});
360+
});
361+
}
360362
if (container.nodeName.toLowerCase() == "div") {
361363
// change the enclosing DIV to a section with notoc
362364
var sec = document.createElement("section") ;

0 commit comments

Comments
 (0)