mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-64488 output: User picture Ally
Do not include alt and title for a user picture if it is hidden from screen readers. Use aria-hidden to properly hide the image from screen readers.
This commit is contained in:
parent
c092f75791
commit
5689bb93e9
@ -2606,9 +2606,16 @@ class core_renderer extends renderer_base {
|
||||
|
||||
$src = $userpicture->get_url($this->page, $this);
|
||||
|
||||
$attributes = array('src'=>$src, 'alt'=>$alt, 'title'=>$alt, 'class'=>$class, 'width'=>$size, 'height'=>$size);
|
||||
$attributes = array('src' => $src, 'class' => $class, 'width' => $size, 'height' => $size);
|
||||
if (!$userpicture->visibletoscreenreaders) {
|
||||
$attributes['role'] = 'presentation';
|
||||
$alt = '';
|
||||
$attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
|
||||
if (!empty($alt)) {
|
||||
$attributes['alt'] = $alt;
|
||||
$attributes['title'] = $alt;
|
||||
}
|
||||
|
||||
// get the image html output fisrt
|
||||
|
Loading…
x
Reference in New Issue
Block a user