Skip to content

Commit

Permalink
Generated by TRAVIS-CI 81ab634
Browse files Browse the repository at this point in the history
Multiple Examples Code Quality: Use local index variables for loops (pull #1370)
  • Loading branch information
michael-n-cooper committed Jun 2, 2020
1 parent 3e40196 commit 43939da
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 34 deletions.
1 change: 0 additions & 1 deletion examples/carousel/js/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,3 @@ window.addEventListener('load', function () {
carousel.init();
}
}, false);

2 changes: 0 additions & 2 deletions examples/dialog-modal/js/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,5 +575,3 @@ DatePicker.prototype.setMessage = function (str) {
this.lastMessage = str;
}
};


35 changes: 17 additions & 18 deletions examples/landmarks/js/visua11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ function initHeadings() {

addPolyfills();

var targetList = [{ selector: "h1", color: "navy", label: "h1" },
{ selector: "h2", color: "olive", label: "h2" },
{ selector: "h3", color: "purple", label: "h3" },
{ selector: "h4", color: "green", label: "h4" },
{ selector: "h5", color: "gray", label: "h5" },
var targetList = [{ selector: "h1", color: "navy", label: "h1" },
{ selector: "h2", color: "olive", label: "h2" },
{ selector: "h3", color: "purple", label: "h3" },
{ selector: "h4", color: "green", label: "h4" },
{ selector: "h5", color: "gray", label: "h5" },
{ selector: "h6", color: "brown", label: "h6" }];

var selectors = targetList.map(function (tgt) {
Expand Down Expand Up @@ -84,16 +84,16 @@ function initLandmarks() {
return false;
}

var targetList = [{ selector: 'aside:not([role]), [role~="complementary"], [role~="COMPLEMENTARY"]', color: "maroon", label: "complementary" },
{ selector: 'form[aria-labelledby], form[aria-label], form[title], [role~="form"], [role~="form"]', color: "maroon", label: "form" },
{ selector: 'footer, [role~="contentinfo"], [role~="CONTENTINFO"]', filter: isContentinfo, color: "olive", label: "contentinfo" },
{ selector: '[role~="application"], [role~="APPLICATION"]', color: "black", label: "application" },
{ selector: 'nav, [role~="navigation"], [role~="NAVIGATION"]', color: "green", label: "navigation" },
{ selector: '[role~="region"][aria-labelledby], [role~="REGION"][aria-labelledby]', color: "teal", label: "region" },
{ selector: '[role~="region"][aria-label], [role~="REGION"][aria-label]', color: "teal", label: "region" },
{ selector: 'section[aria-labelledby], section[aria-label]', color: "teal", label: "region" },
{ selector: 'header, [role~="banner"], [role~="BANNER"]', filter: isBanner, color: "gray", label: "banner" },
{ selector: '[role~="search"], [role~="SEARCH"]', color: "purple", label: "search" },
var targetList = [{ selector: 'aside:not([role]), [role~="complementary"], [role~="COMPLEMENTARY"]', color: "maroon", label: "complementary" },
{ selector: 'form[aria-labelledby], form[aria-label], form[title], [role~="form"], [role~="form"]', color: "maroon", label: "form" },
{ selector: 'footer, [role~="contentinfo"], [role~="CONTENTINFO"]', filter: isContentinfo, color: "olive", label: "contentinfo" },
{ selector: '[role~="application"], [role~="APPLICATION"]', color: "black", label: "application" },
{ selector: 'nav, [role~="navigation"], [role~="NAVIGATION"]', color: "green", label: "navigation" },
{ selector: '[role~="region"][aria-labelledby], [role~="REGION"][aria-labelledby]', color: "teal", label: "region" },
{ selector: '[role~="region"][aria-label], [role~="REGION"][aria-label]', color: "teal", label: "region" },
{ selector: 'section[aria-labelledby], section[aria-label]', color: "teal", label: "region" },
{ selector: 'header, [role~="banner"], [role~="BANNER"]', filter: isBanner, color: "gray", label: "banner" },
{ selector: '[role~="search"], [role~="SEARCH"]', color: "purple", label: "search" },
{ selector: 'main, [role~="main"], [role~="MAIN"]', color: "navy", label: "main" }];

var selectors = targetList.map(function (tgt) {
Expand Down Expand Up @@ -817,15 +817,14 @@ function nameFromNativeSemantics(element, recFlag) {
function nameFromAttributeIdRefs(element, attribute) {
var value = getAttributeValue(element, attribute);
var idRefs,
i,
refElement,
accName,
arr = [];

if (value.length) {
idRefs = value.split(' ');

for (i = 0; i < idRefs.length; i++) {
for (var i = 0; i < idRefs.length; i++) {
refElement = document.getElementById(idRefs[i]);
if (refElement) {
accName = getAccessibleName(refElement, true);
Expand Down Expand Up @@ -1697,4 +1696,4 @@ function addPolyfills() {
}
};
}
}
}
8 changes: 4 additions & 4 deletions examples/tabs/tabs-1/js/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
};

// Bind listeners
for (i = 0; i < tabs.length; ++i) {
for (var i = 0; i < tabs.length; ++i) {
addListeners(i);
}

Expand Down Expand Up @@ -124,7 +124,7 @@
function switchTabOnArrowPress (event) {
var pressed = event.keyCode;

for (x = 0; x < tabs.length; x++) {
for (var x = 0; x < tabs.length; x++) {
tabs[x].addEventListener('focus', focusEventHandler);
}

Expand Down Expand Up @@ -170,13 +170,13 @@

// Deactivate all tabs and tab panels
function deactivateTabs () {
for (t = 0; t < tabs.length; t++) {
for (var t = 0; t < tabs.length; t++) {
tabs[t].setAttribute('tabindex', '-1');
tabs[t].setAttribute('aria-selected', 'false');
tabs[t].removeEventListener('focus', focusEventHandler);
}

for (p = 0; p < panels.length; p++) {
for (var p = 0; p < panels.length; p++) {
panels[p].classList.add('is-hidden');
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/tabs/tabs-2/js/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
};

// Bind listeners
for (i = 0; i < tabs.length; ++i) {
for (var i = 0; i < tabs.length; ++i) {
addListeners(i);
}

Expand Down Expand Up @@ -171,12 +171,12 @@

// Deactivate all tabs and tab panels
function deactivateTabs () {
for (t = 0; t < tabs.length; t++) {
for (var t = 0; t < tabs.length; t++) {
tabs[t].setAttribute('tabindex', '-1');
tabs[t].setAttribute('aria-selected', 'false');
}

for (p = 0; p < panels.length; p++) {
for (var p = 0; p < panels.length; p++) {
panels[p].classList.add('is-hidden');
}
}
Expand Down
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@
"aliasOf": "WAI-ARIA-1.1"
}
},
"publishDate": "2020-06-01",
"publishISODate": "2020-06-01T00:00:00.000Z",
"generatedSubtitle": "Editor's Draft 01 June 2020"
"publishDate": "2020-06-02",
"publishISODate": "2020-06-02T00:00:00.000Z",
"generatedSubtitle": "Editor's Draft 02 June 2020"
}</script><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED"></head>
<body class="h-entry informative"><div class="head">
<a class="logo" href="https://www.w3.org/"><img alt="W3C" width="72" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C"></a> <h1 id="title" class="title">WAI-ARIA Authoring Practices 1.2</h1>

<h2>
W3C Editor's Draft
<time class="dt-published" datetime="2020-06-01">01 June 2020</time>
<time class="dt-published" datetime="2020-06-02">02 June 2020</time>
</h2>
<dl>
<dt>This version:</dt><dd>
Expand Down Expand Up @@ -6981,14 +6981,14 @@ <h3 id="c-4-enabling-funders"><bdi class="secno">C.4 </bdi>Enabling funders<a cl


</section>
<script type="text/javascript">(function(){window['__CF$cv$params']={r:'59c5c2fdabdd9a1a',m:'3d47a9e877d6ac18f07fc0a4469486c7a56e803c-1590981238-1800-AXXBVeP5TP1mR2lsAqa+ZWptqOWYdsK1mU1hwzauKNI89KxsHxAlL8tr1igccp8tjvsmvcaQWXuZJ6Z2hRIJf+VmY6wlYiimo3rm2jZgonznZmbNTHalqIlL4fYnQuzjyO0pUoeMV+LfmJGtkqj07RUdDuIane4ej5GEnVxy1E08mmmFQWJmq012U05u5zxLm+KuS+d8duw8FIkWf8fGHXE=',s:[0x8740b6006d,0x10a67a9d84],}})();</script>
<script type="text/javascript">(function(){window['__CF$cv$params']={r:'59d0000dab3ff051',m:'2d6fc46c0a4caded114dabb4eb7332338cc645e2-1591088596-1800-AX6gNkI7mFqfO4p3RWhjbYSTV/UZt8/7xdb8NEJmrJzEcylTZCNfRXvIaT0PF13xjiqVsa2bOQ490Z6KZCCmWPb1oZQJFk537ho7dJdh/mYE/MT003bprUjB17YxgpkLucFDWZW1/X5ttYRbR2q5auq4ucEt2jEk2gyz5jkbou73SaUupYL+7XmvfY9nlT22ADTlHDiC9zREkigIv1gkLcs=',s:[0xde0ce21efa,0x97a71ab094],}})();</script>

<section id="references" class="appendix"><h2 id="d-references"><bdi class="secno">D. </bdi>References<a class="self-link" aria-label="§" href="#references"></a></h2><section id="informative-references">
<h3 id="d-1-informative-references"><bdi class="secno">D.1 </bdi>
Informative references
<a class="self-link" aria-label="§" href="#informative-references"></a></h3>
<dl class="bibliography">
<dt id="bib-html">[HTML]</dt><dd><a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Anne van Kesteren; Domenic Denicola; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a></dd><dt id="bib-html-aam">[HTML-AAM]</dt><dd><a href="https://www.w3.org/TR/html-aam-1.0/"><cite>HTML Accessibility API Mappings 1.0</cite></a>. Steve Faulkner; Alexander Surkov; Scott O'Hara; Bogdan Brinza; Jason Kiss; Cynthia Shelly. W3C. 29 May 2020. W3C Working Draft. URL: <a href="https://www.w3.org/TR/html-aam-1.0/">https://www.w3.org/TR/html-aam-1.0/</a></dd><dt id="bib-html-aria">[HTML-ARIA]</dt><dd><a href="https://www.w3.org/TR/html-aria/"><cite>ARIA in HTML</cite></a>. Steve Faulkner; Scott O'Hara. W3C. 20 May 2020. W3C Working Draft. URL: <a href="https://www.w3.org/TR/html-aria/">https://www.w3.org/TR/html-aria/</a></dd><dt id="bib-svg2">[SVG2]</dt><dd><a href="https://www.w3.org/TR/SVG2/"><cite>Scalable Vector Graphics (SVG) 2</cite></a>. Amelia Bellamy-Royds; Bogdan Brinza; Chris Lilley; Dirk Schulze; David Storey; Eric Willigers. W3C. 4 October 2018. W3C Candidate Recommendation. URL: <a href="https://www.w3.org/TR/SVG2/">https://www.w3.org/TR/SVG2/</a></dd><dt id="bib-wai-aria">[WAI-ARIA]</dt><dd><a href="https://www.w3.org/TR/wai-aria-1.1/"><cite>Accessible Rich Internet Applications (WAI-ARIA) 1.1</cite></a>. Joanmarie Diggs; Shane McCarron; Michael Cooper; Richard Schwerdtfeger; James Craig. W3C. 14 December 2017. W3C Recommendation. URL: <a href="https://www.w3.org/TR/wai-aria-1.1/">https://www.w3.org/TR/wai-aria-1.1/</a></dd><dt id="bib-wai-aria-1.2">[WAI-ARIA-1.2]</dt><dd><a href="https://www.w3.org/TR/wai-aria-1.2/"><cite>Accessible Rich Internet Applications (WAI-ARIA) 1.2</cite></a>. Joanmarie Diggs; Shane McCarron; James Nurthen; Michael Cooper; Richard Schwerdtfeger; James Craig. W3C. 18 December 2019. W3C Working Draft. URL: <a href="https://www.w3.org/TR/wai-aria-1.2/">https://www.w3.org/TR/wai-aria-1.2/</a></dd>
<dt id="bib-html">[HTML]</dt><dd><a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Anne van Kesteren; Domenic Denicola; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a></dd><dt id="bib-html-aam">[HTML-AAM]</dt><dd><a href="https://www.w3.org/TR/html-aam-1.0/"><cite>HTML Accessibility API Mappings 1.0</cite></a>. Steve Faulkner; Alexander Surkov; Scott O'Hara; Bogdan Brinza; Jason Kiss; Cynthia Shelly. W3C. 1 June 2020. W3C Working Draft. URL: <a href="https://www.w3.org/TR/html-aam-1.0/">https://www.w3.org/TR/html-aam-1.0/</a></dd><dt id="bib-html-aria">[HTML-ARIA]</dt><dd><a href="https://www.w3.org/TR/html-aria/"><cite>ARIA in HTML</cite></a>. Steve Faulkner; Scott O'Hara. W3C. 20 May 2020. W3C Working Draft. URL: <a href="https://www.w3.org/TR/html-aria/">https://www.w3.org/TR/html-aria/</a></dd><dt id="bib-svg2">[SVG2]</dt><dd><a href="https://www.w3.org/TR/SVG2/"><cite>Scalable Vector Graphics (SVG) 2</cite></a>. Amelia Bellamy-Royds; Bogdan Brinza; Chris Lilley; Dirk Schulze; David Storey; Eric Willigers. W3C. 4 October 2018. W3C Candidate Recommendation. URL: <a href="https://www.w3.org/TR/SVG2/">https://www.w3.org/TR/SVG2/</a></dd><dt id="bib-wai-aria">[WAI-ARIA]</dt><dd><a href="https://www.w3.org/TR/wai-aria-1.1/"><cite>Accessible Rich Internet Applications (WAI-ARIA) 1.1</cite></a>. Joanmarie Diggs; Shane McCarron; Michael Cooper; Richard Schwerdtfeger; James Craig. W3C. 14 December 2017. W3C Recommendation. URL: <a href="https://www.w3.org/TR/wai-aria-1.1/">https://www.w3.org/TR/wai-aria-1.1/</a></dd><dt id="bib-wai-aria-1.2">[WAI-ARIA-1.2]</dt><dd><a href="https://www.w3.org/TR/wai-aria-1.2/"><cite>Accessible Rich Internet Applications (WAI-ARIA) 1.2</cite></a>. Joanmarie Diggs; Shane McCarron; James Nurthen; Michael Cooper; Richard Schwerdtfeger; James Craig. W3C. 18 December 2019. W3C Working Draft. URL: <a href="https://www.w3.org/TR/wai-aria-1.2/">https://www.w3.org/TR/wai-aria-1.2/</a></dd>
</dl></section></section><p role="navigation" id="back-to-top">
<a href="#title"><abbr title="Back to Top">↑</abbr></a>
</p><script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script></body></html>

0 comments on commit 43939da

Please sign in to comment.