Skip to content

Commit 03d62a0

Browse files
Copilotsstidl
andauthored
fix: add aria-label to startStopBtn for screen reader accessibility (#785)
Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/cfb05653-7d75-4f0d-9e9a-1765eeaa8903 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
1 parent da29334 commit 03d62a0

8 files changed

Lines changed: 27 additions & 8 deletions

examples/example-multipleServers-full.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,21 @@
126126
s.abort();
127127
data=null;
128128
I("startStopBtn").className="";
129+
I("startStopBtn").setAttribute("aria-label","Start");
129130
I("server").disabled=false;
130131
initUI();
131132
}else{
132133
//test is not running, begin
133134
I("startStopBtn").className="running";
135+
I("startStopBtn").setAttribute("aria-label","Abort");
134136
I("shareArea").style.display="none";
135137
I("server").disabled=true;
136138
s.onupdate=function(data){
137139
uiData=data;
138140
};
139141
s.onend=function(aborted){
140142
I("startStopBtn").className="";
143+
I("startStopBtn").setAttribute("aria-label","Start");
141144
I("server").disabled=false;
142145
updateUI(true);
143146
if(!aborted){
@@ -404,7 +407,7 @@ <h1>LibreSpeed Example</h1>
404407
<p id="message"><span class="loadCircle"></span>Selecting a server...</p>
405408
</div>
406409
<div id="testWrapper" class="hidden">
407-
<button id="startStopBtn" onclick="startStop()"></button><br/>
410+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button><br/>
408411
<a class="privacy" href="#" onclick="I('privacyPolicy').style.display=''">Privacy</a>
409412
<div id="serverArea">
410413
Server: <select id="server" onchange="s.setSelectedServer(SPEEDTEST_SERVERS[this.value])"></select>

examples/example-multipleServers-pretty.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
}
4343
s.onend=function(aborted){ //callback for test ended/aborted
4444
I("startStopBtn").className=""; //show start button again
45+
I("startStopBtn").setAttribute("aria-label","Start");
4546
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
4647
initUI();
4748
}
@@ -83,6 +84,7 @@
8384
//test is not running, begin
8485
s.start();
8586
I("startStopBtn").className="running";
87+
I("startStopBtn").setAttribute("aria-label","Abort");
8688
}
8789
}
8890

@@ -207,7 +209,7 @@
207209
</head>
208210
<body>
209211
<h1>LibreSpeed Example</h1>
210-
<button id="startStopBtn" onclick="startStop()"></button>
212+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button>
211213
<div id="serverId">Selecting server...</div>
212214
<div id="test">
213215
<div class="testGroup">

examples/example-singleServer-customSettings.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
}
2323
s.onend=function(aborted){ //callback for test ended/aborted
2424
I("startStopBtn").className=""; //show start button again
25+
I("startStopBtn").setAttribute("aria-label","Start");
2526
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
2627
initUI();
2728
}
@@ -35,6 +36,7 @@
3536
//test is not running, begin
3637
s.start();
3738
I("startStopBtn").className="running";
39+
I("startStopBtn").setAttribute("aria-label","Abort");
3840
}
3941
}
4042

@@ -153,7 +155,7 @@
153155
</head>
154156
<body>
155157
<h1>LibreSpeed Example</h1>
156-
<button id="startStopBtn" onclick="startStop()"></button>
158+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button>
157159
<div id="test">
158160
<div class="testGroup">
159161
<div class="testArea">

examples/example-singleServer-gauges.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,18 @@
6060
s.abort();
6161
data=null;
6262
I("startStopBtn").className="";
63+
I("startStopBtn").setAttribute("aria-label","Start");
6364
initUI();
6465
}else{
6566
//test is not running, begin
6667
I("startStopBtn").className="running";
68+
I("startStopBtn").setAttribute("aria-label","Abort");
6769
s.onupdate=function(data){
6870
uiData=data;
6971
};
7072
s.onend=function(aborted){
7173
I("startStopBtn").className="";
74+
I("startStopBtn").setAttribute("aria-label","Start");
7275
updateUI(true);
7376
};
7477
s.start();
@@ -225,7 +228,7 @@
225228
<body>
226229
<h1>LibreSpeed Example</h1>
227230
<div id="testWrapper">
228-
<button id="startStopBtn" onclick="startStop()"></button>
231+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button>
229232
<div id="test">
230233
<div class="testGroup">
231234
<div class="testArea2">

examples/example-singleServer-modern.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
}
2424
s.onend=function(aborted){ //callback for test ended/aborted
2525
I("startStopBtn").className=""; //show start button again
26+
I("startStopBtn").setAttribute("aria-label","Start");
2627
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
2728
initUI();
2829
} else {
@@ -44,6 +45,7 @@
4445
//test is not running, begin
4546
s.start();
4647
I("startStopBtn").className="running";
48+
I("startStopBtn").setAttribute("aria-label","Abort");
4749
}
4850
}
4951

@@ -190,7 +192,7 @@
190192
</head>
191193
<body>
192194
<h1>LibreSpeed</h1>
193-
<button id="startStopBtn" onclick="startStop()"></button>
195+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button>
194196
<div id="test">
195197
<div class="testGroup">
196198
<div class="testArea">

examples/example-singleServer-pretty.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
}
2020
s.onend=function(aborted){ //callback for test ended/aborted
2121
I("startStopBtn").className=""; //show start button again
22+
I("startStopBtn").setAttribute("aria-label","Start");
2223
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
2324
initUI();
2425
}
@@ -32,6 +33,7 @@
3233
//test is not running, begin
3334
s.start();
3435
I("startStopBtn").className="running";
36+
I("startStopBtn").setAttribute("aria-label","Abort");
3537
}
3638
}
3739

@@ -156,7 +158,7 @@
156158
</head>
157159
<body>
158160
<h1>LibreSpeed Example</h1>
159-
<button id="startStopBtn" onclick="startStop()"></button>
161+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button>
160162
<div id="test">
161163
<div class="testGroup">
162164
<div class="testArea">

examples/example-singleServer-progressBar.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}
2222
s.onend=function(aborted){ //callback for test ended/aborted
2323
I("startStopBtn").className=""; //show start button again
24+
I("startStopBtn").setAttribute("aria-label","Start");
2425
if(aborted){ //if the test was aborted, clear the UI and prepare for new test
2526
initUI();
2627
}
@@ -34,6 +35,7 @@
3435
//test is not running, begin
3536
s.start();
3637
I("startStopBtn").className="running";
38+
I("startStopBtn").setAttribute("aria-label","Abort");
3739
}
3840
}
3941

@@ -175,7 +177,7 @@
175177
</head>
176178
<body>
177179
<h1>LibreSpeed Example</h1>
178-
<button id="startStopBtn" onclick="startStop()"></button>
180+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button>
179181
<div id="test">
180182
<div id="progressBar"><div id="progress"></div></div>
181183
<div class="testGroup">

index-classic.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,21 @@
135135
s.abort();
136136
data = null;
137137
I("startStopBtn").className = "";
138+
I("startStopBtn").setAttribute("aria-label", "Start");
138139
I("server").disabled = false;
139140
initUI();
140141
} else {
141142
//test is not running, begin
142143
I("startStopBtn").className = "running";
144+
I("startStopBtn").setAttribute("aria-label", "Abort");
143145
I("shareArea").style.display = "none";
144146
I("server").disabled = true;
145147
s.onupdate = function (data) {
146148
uiData = data;
147149
};
148150
s.onend = function (aborted) {
149151
I("startStopBtn").className = "";
152+
I("startStopBtn").setAttribute("aria-label", "Start");
150153
I("server").disabled = false;
151154
updateUI(true);
152155
if (!aborted) {
@@ -492,7 +495,7 @@ <h1>LibreSpeed</h1>
492495
<p id="message"><span class="loadCircle"></span>Selecting a server...</p>
493496
</div>
494497
<div id="testWrapper" class="hidden">
495-
<button id="startStopBtn" onclick="startStop()"></button><br />
498+
<button id="startStopBtn" onclick="startStop()" aria-label="Start"></button><br />
496499
<a class="privacy" href="#" onclick="I('privacyPolicy').style.display=''">Privacy</a>
497500
<div id="serverArea">
498501
Server: <select id="server" onchange="s.setSelectedServer(SPEEDTEST_SERVERS[this.value])"></select>

0 commit comments

Comments
 (0)