Commit eba69eb1 authored by Hector Carmona's avatar Hector Carmona Committed by Commit Bot

Navi A11y - Focus Heading in each step of onboarding for screen readers.

Bug: 920685
Change-Id: Ibbb068b85f5bd3a94b5823dbece9409ea68bcb36
Reviewed-on: https://chromium-review.googlesource.com/c/1406180
Commit-Queue: Hector Carmona <hcarmona@chromium.org>
Reviewed-by: default avatarDan Beam <dbeam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622118}
parent 1e100475
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
.email-logo { .email-logo {
content: -webkit-image-set( content: -webkit-image-set(
url(../images/email_provider_1x.png) 1x, url(../images/email_provider_1x.png) 1x,
url(../images/email_provider_2x.png) 2x); url(../images/email_provider_2x.png) 2x);
height: 38px; height: 38px;
margin: auto; margin: auto;
margin-bottom: 16px; margin-bottom: 16px;
...@@ -28,11 +28,12 @@ ...@@ -28,11 +28,12 @@
font-weight: 500; font-weight: 500;
margin: 0; margin: 0;
margin-bottom: 48px; margin-bottom: 48px;
outline: none;
} }
</style> </style>
<div class="email-ask"> <div class="email-ask">
<div class="email-logo" alt=""></div> <div class="email-logo" alt=""></div>
<h1>$i18n{emailProviderTitle}</h1> <h1 tabindex="-1">$i18n{emailProviderTitle}</h1>
<app-chooser id="emailChooser" indicator-model="[[indicatorModel]]" <app-chooser id="emailChooser" indicator-model="[[indicatorModel]]"
single-select> single-select>
</app-chooser> </app-chooser>
......
...@@ -35,11 +35,12 @@ ...@@ -35,11 +35,12 @@
h1 { h1 {
margin-top: 0; margin-top: 0;
outline: none;
} }
</style> </style>
<onboarding-background></onboarding-background> <onboarding-background></onboarding-background>
<div id="container"> <div id="container">
<h1>$i18n{emailInterstitialTitle}</h1> <h1 tabindex="-1">$i18n{emailInterstitialTitle}</h1>
<paper-button class="action-button" on-click="onContinueClick_"> <paper-button class="action-button" on-click="onContinueClick_">
$i18n{emailInterstitialContinue} $i18n{emailInterstitialContinue}
</paper-button> </paper-button>
......
...@@ -37,6 +37,12 @@ Polymer({ ...@@ -37,6 +37,12 @@ Polymer({
}); });
}, },
/** @override */
attached: function() {
// Focus heading for accessibility.
this.$$('h1').focus();
},
/** @private */ /** @private */
onContinueClick_: function() { onContinueClick_: function() {
this.finalized_ = true; this.finalized_ = true;
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
font-weight: 500; font-weight: 500;
margin: 0; margin: 0;
margin-bottom: 48px; margin-bottom: 48px;
outline: none;
} }
</style> </style>
<div class="apps-ask"> <div class="apps-ask">
<div class="chrome-logo" alt=""></div> <div class="chrome-logo" alt=""></div>
<h1>$i18n{googleAppsDescription}</h1> <h1 tabindex="-1">$i18n{googleAppsDescription}</h1>
<app-chooser id="appChooser" indicator-model="[[indicatorModel]]"> <app-chooser id="appChooser" indicator-model="[[indicatorModel]]">
</app-chooser> </app-chooser>
</div> </div>
......
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
<template> <template>
<style <style
include="paper-button-style action-link-style splash-pages-shared-css"> include="paper-button-style action-link-style splash-pages-shared-css">
h1 {
outline: none;
}
</style> </style>
<onboarding-background></onboarding-background> <onboarding-background></onboarding-background>
<div id="container"> <div id="container">
<h2>$i18n{landingDescription}</h2> <h2>$i18n{landingDescription}</h2>
<h1>$i18n{landingTitle}</h1> <h1 tabindex="-1">$i18n{landingTitle}</h1>
<paper-button class="action-button" on-click="onNewUserClick_"> <paper-button class="action-button" on-click="onNewUserClick_">
$i18n{landingNewUser} $i18n{landingNewUser}
</paper-button> </paper-button>
......
...@@ -81,6 +81,8 @@ cr.define('welcome', function() { ...@@ -81,6 +81,8 @@ cr.define('welcome', function() {
if (currentRouteElement) { if (currentRouteElement) {
(/** @type {{onRouteEnter: Function}} */ (currentRouteElement)) (/** @type {{onRouteEnter: Function}} */ (currentRouteElement))
.onRouteEnter(); .onRouteEnter();
(/** @type {{updateFocusForA11y: Function}} */ (currentRouteElement))
.updateFocusForA11y();
} }
} }
...@@ -153,6 +155,15 @@ cr.define('welcome', function() { ...@@ -153,6 +155,15 @@ cr.define('welcome', function() {
if (this.id == `step-${step}`) { if (this.id == `step-${step}`) {
currentRouteElement = this; currentRouteElement = this;
this.onRouteEnter(); this.onRouteEnter();
this.updateFocusForA11y();
}
},
/** Called to update focus when progressing through the modules. */
updateFocusForA11y: function() {
const header = this.$$('h1');
if (header) {
Polymer.RenderStatus.afterNextRender(this, () => header.focus());
} }
}, },
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
font-weight: 500; font-weight: 500;
line-height: 2.5rem; line-height: 2.5rem;
margin: 0; margin: 0;
outline: none;
} }
h2 { h2 {
...@@ -73,7 +74,7 @@ ...@@ -73,7 +74,7 @@
</style> </style>
<div class="container"> <div class="container">
<div class="logo"></div> <div class="logo"></div>
<h1>$i18n{setDefaultHeader}</h1> <h1 tabindex="-1">$i18n{setDefaultHeader}</h1>
<h2>$i18n{setDefaultSubHeader}</h2> <h2>$i18n{setDefaultSubHeader}</h2>
<div class="illustration"></div> <div class="illustration"></div>
<div class="button-bar"> <div class="button-bar">
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
<template> <template>
<style <style
include="paper-button-style action-link-style splash-pages-shared-css"> include="paper-button-style action-link-style splash-pages-shared-css">
h1 {
outline: none;
}
</style> </style>
<onboarding-background></onboarding-background> <onboarding-background></onboarding-background>
<div id="container"> <div id="container">
<h2>$i18n{signInSubHeader}</h2> <h2>$i18n{signInSubHeader}</h2>
<h1>$i18n{signInHeader}</h1> <h1 tabindex="-1">$i18n{signInHeader}</h1>
<paper-button class="action-button" on-click="onSignInClick_"> <paper-button class="action-button" on-click="onSignInClick_">
$i18n{signIn} $i18n{signIn}
</paper-button> </paper-button>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment