Skip to content

Commit 3bf7828

Browse files
author
Aaron Cannon
committed
A11y: Added titles to all visible iframes
Fixes CNVS-25343 Test plan: - Verify that every visible iframe in Canvas has a non-empty title attribute - Verify that every title attribute on an iframe has meaningful content , which correctly indicates the content the iframe contains. Change-Id: Iac3a2031a81836b11e1e4bfdc2d242777a493172 Reviewed-on: https://gerrit.instructure.com/68027 Reviewed-by: Simon Williams <simon@instructure.com> Product-Review: Simon Williams <simon@instructure.com> Tested-by: Jenkins QA-Review: Simon Williams <simon@instructure.com>
1 parent 2169acc commit 3bf7828

18 files changed

Lines changed: 28 additions & 23 deletions

File tree

app/coffeescripts/bundles/all_courses.coffee

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
require [
2+
'i18n!catalog'
23
'jquery'
34
'jqueryui/dialog',
4-
], ($) ->
5+
], (I18n, $) ->
56
handleNav = (e) ->
67
return if !history.pushState
78
if this.href
@@ -22,7 +23,7 @@ require [
2223
$course.find('h3 a')[0].click()
2324
return
2425
$dialog = $("<div>")
25-
$iframe = $('<iframe>', style: "position:absolute;top:0;left:0;width:100%;height:100%;border:none", src: link.href + '?embedded=1&no_headers=1')
26+
$iframe = $('<iframe>', style: "position:absolute;top:0;left:0;width:100%;height:100%;border:none", src: link.href + '?embedded=1&no_headers=1', title: I18n.t 'Course Catalog')
2627
$dialog.append $iframe
2728
$dialog.dialog
2829
width: 550

app/coffeescripts/registration/main.coffee

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ define [
44
'compiled/registration/signupDialog'
55
'jst/registration/login'
66
'compiled/behaviors/authenticity_token'
7-
], ($, preventDefault, signupDialog, loginForm, authenticity_token) ->
7+
'str/htmlEscape'
8+
'i18n!registration'
9+
], ($, preventDefault, signupDialog, loginForm, authenticity_token, htmlEscape, I18n) ->
810
$loginForm = null
911

1012
$('.signup_link').click preventDefault ->
1113
signupDialog($(this).data('template'), $(this).prop('title'), $(this).data('path'))
1214

1315
$('#registration_video a').click preventDefault ->
14-
$('<div style="padding:0;"><iframe style="float:left;" src="//player.vimeo.com/video/35336470?portrait=0&amp;color=7fc8ff&amp;autoplay=1" width="800" height="450" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>')
16+
$("<div style='padding:0;'><iframe style='float:left;' src='//player.vimeo.com/video/35336470?portrait=0&amp;color=7fc8ff&amp;autoplay=1' width='800' height='450' frameborder='0' title='#{htmlEscape(I18n.t 'Video Player')}' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>")
1517
.dialog
1618
width: 800,
17-
title: "Canvas Introduction Video",
19+
title: I18n.t "Canvas Introduction Video",
1820
modal: true,
1921
resizable: false,
2022
close: -> $(this).remove()

app/coffeescripts/str/apiUserContent.coffee

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ define [
22
'jquery'
33
'underscore'
44
'str/htmlEscape'
5-
], ($, _, htmlEscape) ->
5+
'i18n!user_content'
6+
], ($, _, htmlEscape, I18n) ->
67

78
apiUserContent = {
89

@@ -57,7 +58,7 @@ define [
5758
$form.append($("<input type='hidden'/>").attr({name: 's', value: $this.data('uc_sig')}))
5859
$('body').append($form)
5960
setTimeout((-> $form.submit()), 0)
60-
$("<iframe class='user_content_iframe' name='#{htmlEscape(uuid)}' style='width: #{htmlEscape($this.data('uc_width'))}; height: #{htmlEscape($this.data('uc_height'))};' frameborder='0' />")
61+
$("<iframe class='user_content_iframe' name='#{htmlEscape(uuid)}' style='width: #{htmlEscape($this.data('uc_width'))}; height: #{htmlEscape($this.data('uc_height'))};' frameborder='0' title='#{htmlEscape(I18n.t 'User Content')}' />")
6162

6263
$dummy.find('img.equation_image').each((index, equationImage)->
6364
$equationImage = $(equationImage)

app/jsx/external_apps/components/ConfigureExternalToolButton.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ define([
5454

5555
renderIframe() {
5656
if (this.state.modalIsOpen) {
57-
return <iframe src={this.getLaunchUrl()} style={{
57+
return <iframe src={this.getLaunchUrl()} title={I18n.t('Tool Configuration')} style={{
5858
width: '100%',
5959
padding: 0,
6060
margin: 0,

app/jsx/external_apps/components/Lti2Iframe.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ define([
3737
render() {
3838
return (
3939
<div className="ReactModal__Body" style={{padding: '0px !important'}}>
40-
<iframe src={this.getLaunchUrl()} style={{width: '100%', padding: 0, margin: 0, height: 500, border: 0}}/>
40+
<iframe src={this.getLaunchUrl()} style={{width: '100%', padding: 0, margin: 0, height: 500, border: 0}} title={I18n.t('Tool Content')}/>
4141
</div>
4242
)
4343
}

app/jsx/theme_editor/ThemeEditor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ define([
434434
</button>
435435
</div>
436436
: null }
437-
<iframe id="previewIframe" ref="previewIframe" src={"/accounts/"+this.props.accountID+"/theme-preview/?editing_brand_config=1"} />
437+
<iframe id="previewIframe" ref="previewIframe" src={"/accounts/"+this.props.accountID+"/theme-preview/?editing_brand_config=1"} title={I18n.t('Preview')} />
438438
</div>
439439

440440
</div>

app/views/brand_configs/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,6 @@
226226
<%= t('Login') %>
227227
</h3>
228228
<div class="ic-login--theme-preview">
229-
<iframe id="login-preview-iframe" src="<%= canvas_login_url(previewing_from_themeeditor: true) %>" ></iframe>
229+
<iframe id="login-preview-iframe" src="<%= canvas_login_url(previewing_from_themeeditor: true) %>" title="<%= t('Login') %>" ></iframe>
230230
</div>
231231
</div>

app/views/eportfolios/_page_section.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<% elsif page_section["section_type"] == "submission" %>
3636
<% submission = @portfolio.user.submissions.where(id: page_section["submission_id"]).first if page_section["submission_id"].present? %>
3737
<% if submission %>
38-
<iframe class="submission_preview" src="<%= eportfolio_entry_preview_submission_path(@portfolio, @page, submission.id) %>" style="border: 1px solid #aaa; width: 100%; height: 300px; display: block; margin-left: auto; margin-right: auto;">
38+
<iframe class="submission_preview" src="<%= eportfolio_entry_preview_submission_path(@portfolio, @page, submission.id) %>" style="border: 1px solid #aaa; width: 100%; height: 300px; display: block; margin-left: auto; margin-right: auto;" title="<%= t('Preview') %>">
3939
</iframe>
4040
<% end %>
4141
<% end %>

app/views/eportfolios/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
</div>
312312
<%= form_for :attachment, :url => context_url(@portfolio.user, :controller => :files, :action => :create, :format => "text"), :html => {:id => "upload_file_form"} do |f| %>
313313
<% end %>
314-
<iframe class="submission_preview" style="border: 1px solid #aaa; width: 95%; height: 300px; display: block; margin-left: auto; margin-right: auto;" src="about:blank">
314+
<iframe class="submission_preview" style="border: 1px solid #aaa; width: 95%; height: 300px; display: block; margin-left: auto; margin-right: auto;" src="about:blank" title="<%= t('Preview') %>">
315315
</iframe>
316316
</div>
317317
<div style="display: none;">

app/views/files/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<a style="display:block;" href="<%= safe_domain_file_url(@attachment, nil, nil, true) %>">Download <%= @attachment.display_name %></a>
3333
<% elsif @attachment.inline_content? %>
3434
<% js_bundle :file_inline %>
35-
<iframe id="file_content" src="<%= safe_domain_file_url(@attachment) %>" style="width: 100%; height: 400px;"></iframe>
35+
<iframe id="file_content" src="<%= safe_domain_file_url(@attachment) %>" style="width: 100%; height: 400px;" title="<%= t('File Content') %>"></iframe>
3636
<% elsif @attachment.content_type && @attachment.content_type.match(/\Aimage\//) %>
3737
<h2><%= @attachment.display_name %></h2>
3838
<%= link_to(image_tag(download_url, :alt => @attachment.display_name), download_url) %>

0 commit comments

Comments
 (0)