From 633e97845fdddc3b8ad5ef340f8861b4fe8a91fb Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Mon, 14 Jan 2019 15:06:23 +0800 Subject: [PATCH] MDL-64570 accessibility: purpose login fields Provide the autocomplete attribute and username / current-password values to username and password fields in login forms. https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html --- blocks/login/block_login.php | 4 ++-- lib/templates/loginform.mustache | 4 ++-- theme/boost/templates/core/loginform.mustache | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/blocks/login/block_login.php b/blocks/login/block_login.php index 67d0d0341df..24e65956a9c 100644 --- a/blocks/login/block_login.php +++ b/blocks/login/block_login.php @@ -67,11 +67,11 @@ class block_login extends block_base { $this->content->text .= "\n".'
'; $this->content->text .= '
'; - $this->content->text .= '
'; + $this->content->text .= ''; $this->content->text .= '
'; - $this->content->text .= '
'; + $this->content->text .= ''; if (isset($CFG->rememberusername) and $CFG->rememberusername == 2) { $checked = $username ? 'checked="checked"' : ''; diff --git a/lib/templates/loginform.mustache b/lib/templates/loginform.mustache index 7aa51a62cfc..9448feab522 100644 --- a/lib/templates/loginform.mustache +++ b/lib/templates/loginform.mustache @@ -75,14 +75,14 @@
- +
- +
diff --git a/theme/boost/templates/core/loginform.mustache b/theme/boost/templates/core/loginform.mustache index 54500891921..b0cdaa055e4 100644 --- a/theme/boost/templates/core/loginform.mustache +++ b/theme/boost/templates/core/loginform.mustache @@ -136,13 +136,15 @@ + placeholder={{#quote}}{{^canloginbyemail}}{{#str}}username{{/str}}{{/canloginbyemail}}{{#canloginbyemail}}{{#str}}usernameemail{{/str}}{{/canloginbyemail}}{{/quote}} + autocomplete="username">
+ placeholder={{#quote}}{{#str}}password{{/str}}{{/quote}} + autocomplete="current-password">
{{#rememberusername}}