Skip to content

Commit 126cd61

Browse files
Address basic accessibility issues
These are super basic issues that were flagged by the axe browser extension. I tried to change as few things as possible to avoid breaking anything that might be making assumptions about the markup on this page. Generally, there is a lot more work that would need to be done on these pages to make them as friendly as possible to assistive technologies. Relevant: - https://dequeuniversity.com/rules/axe/4.1/landmark-one-main - https://dequeuniversity.com/rules/axe/4.1/color-contrast
1 parent 46c19a2 commit 126cd61

File tree

10 files changed

+28
-24
lines changed

10 files changed

+28
-24
lines changed

actionpack/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove inline styles and address basic accessibilty issues on rescue templates.
2+
3+
*Jacob Herrington*
4+
15
* Add support for 'private, no-store' Cache-Control headers.
26

37
Previously, 'no-store' was exclusive; no other directives could be specified.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<header>
22
<h1>Blocked host: <%= @host %></h1>
33
</header>
4-
<div id="container">
4+
<main role="main" id="container">
55
<h2>To allow requests to <%= @host %>, add the following to your environment configuration:</h2>
66
<pre>config.hosts &lt;&lt; "<%= @host %>"</pre>
7-
</div>
7+
</main>

actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</h1>
88
</header>
99

10-
<div id="container">
10+
<main role="main" id="container">
1111
<%= render "rescues/message_and_suggestions", exception: @exception %>
1212
<%= render "rescues/actions", exception: @exception, request: @request %>
1313

@@ -32,4 +32,4 @@
3232
<% end %>
3333

3434
<%= render template: "rescues/_request_and_response" %>
35-
</div>
35+
</main>

actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<header>
1+
<header role="banner">
22
<h1>
33
<%= @exception.class.to_s %>
44
<% if @request.parameters['controller'] %>
@@ -7,7 +7,7 @@
77
</h1>
88
</header>
99

10-
<div id="container">
10+
<main role="main" id="container">
1111
<h2>
1212
<%= h @exception.message %>
1313
<% if defined?(ActiveStorage) && @exception.message.match?(%r{#{ActiveStorage::Blob.table_name}|#{ActiveStorage::Attachment.table_name}}) %>
@@ -21,4 +21,4 @@
2121
<%= render "rescues/source", source_extracts: @source_extracts, show_source_idx: @show_source_idx %>
2222
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show %>
2323
<%= render template: "rescues/_request_and_response" %>
24-
</div>
24+
</main>

actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129

130130
.source .data .line_numbers {
131131
background-color: #ECECEC;
132-
color: #AAA;
132+
color: #555;
133133
padding: 1em .5em;
134134
border-right: 1px solid #DDD;
135135
text-align: right;
@@ -261,7 +261,7 @@
261261
</head>
262262
<body>
263263

264-
<%= yield %>
264+
<%= yield %>
265265

266266
</body>
267267
</html>

actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<header>
1+
<header role="banner">
22
<h1>No template for interactive request</h1>
33
</header>
44

5-
<div id="container">
5+
<main id="container">
66
<h2><%= h @exception.message %></h2>
77

88
<p class="summary">
@@ -16,4 +16,4 @@
1616
since we expect an HTML template
1717
to be rendered for such requests. If that's the case, carry on.
1818
</p>
19-
</div>
19+
</main>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<header>
1+
<header role="banner">
22
<h1>Template is missing</h1>
33
</header>
44

5-
<div id="container">
5+
<main role="main" id="container">
66
<h2><%= h @exception.message %></h2>
77

88
<%= render "rescues/source", source_extracts: @source_extracts, show_source_idx: @show_source_idx %>
99
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show %>
1010
<%= render template: "rescues/_request_and_response" %>
11-
</div>
11+
</main>

actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<header>
1+
<header role="banner">
22
<h1>Routing Error</h1>
33
</header>
4-
<div id="container">
4+
<main role="main" id="container">
55
<h2><%= h @exception.message %></h2>
66
<% unless @exception.failures.empty? %>
77
<p>
@@ -29,4 +29,4 @@
2929
<% end %>
3030

3131
<%= render template: "rescues/_request_and_response" %>
32-
</div>
32+
</main>

actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<header>
1+
<header role="banner">
22
<h1>
33
<%= @exception.cause.class.to_s %> in
44
<%= @request.parameters["controller"].camelize if @request.parameters["controller"] %>#<%= @request.parameters["action"] %>
55
</h1>
66
</header>
77

8-
<div id="container">
8+
<main role="main" id="container">
99
<p>
1010
Showing <i><%= @exception.file_name %></i> where line <b>#<%= @exception.line_number %></b> raised:
1111
</p>
@@ -17,4 +17,4 @@
1717

1818
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show %>
1919
<%= render template: "rescues/_request_and_response" %>
20-
</div>
20+
</main>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<header>
1+
<header role="banner">
22
<h1>Unknown action</h1>
33
</header>
4-
<div id="container">
4+
<main role="main" id="container">
55
<%= render "rescues/message_and_suggestions", exception: @exception %>
6-
</div>
6+
</main>

0 commit comments

Comments
 (0)