Commit 20eba307 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview refresh: Fix some a11y issues

Ensure scale and copies have aria-labels (aria-labelledby no longer
works when using cr-input instead of input).

Add an aria-label for the custom pages radio button.

Bug: None
Change-Id: I564a31a0e9501becd2200c7c881d526772f731c6
Reviewed-on: https://chromium-review.googlesource.com/1233119
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592631}
parent f4a3540f
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
<message name="IDS_PRINT_PREVIEW_OPTION_ALL_PAGES" desc="Option to print all pages."> <message name="IDS_PRINT_PREVIEW_OPTION_ALL_PAGES" desc="Option to print all pages.">
All All
</message> </message>
<message name="IDS_PRINT_PREVIEW_OPTION_CUSTOM_PAGES" desc="Option to print custom pages.">
Custom
</message>
<message name="IDS_PRINT_PREVIEW_DESTINATION_LABEL" desc="Destination option label. It is displayed right on top of the available printers list."> <message name="IDS_PRINT_PREVIEW_DESTINATION_LABEL" desc="Destination option label. It is displayed right on top of the available printers list.">
Destination Destination
</message> </message>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
</style> </style>
<print-preview-number-settings-section max-value="999" min-value="1" <print-preview-number-settings-section max-value="999" min-value="1"
default-value="1" input-label="$i18n{copiesLabel}" default-value="1" input-label="$i18n{copiesLabel}"
input-aria-label="$i18n{copiesLabel}"
disabled="[[disabled]]" current-value="{{currentValue_}}" disabled="[[disabled]]" current-value="{{currentValue_}}"
input-valid="{{inputValid_}}" hint-message="$i18n{copiesInstruction}"> input-valid="{{inputValid_}}" hint-message="$i18n{copiesInstruction}">
<div slot="opt-inside-content" class="checkbox" aria-live="polite" <div slot="opt-inside-content" class="checkbox" aria-live="polite"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<print-preview-settings-section> <print-preview-settings-section>
<span id="dpi-label" slot="title">$i18n{dpiLabel}</span> <span id="dpi-label" slot="title">$i18n{dpiLabel}</span>
<div slot="controls"> <div slot="controls">
<print-preview-settings-select aria-labelled-by="dpi-label" <print-preview-settings-select aria-labelledby="dpi-label"
capability="[[capabilityWithLabels_]]" setting-name="dpi" capability="[[capabilityWithLabels_]]" setting-name="dpi"
settings="{{settings}}" disabled="[[disabled]]"> settings="{{settings}}" disabled="[[disabled]]">
</print-preview-settings-select> </print-preview-settings-select>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<cr-input id="userValue" type="number" <cr-input id="userValue" type="number"
max="[[maxValue]]" min="[[minValue]]" data-timeout-delay="250" max="[[maxValue]]" min="[[minValue]]" data-timeout-delay="250"
disabled$="[[getDisabled_(disabled)]]" on-keydown="onKeydown_" disabled$="[[getDisabled_(disabled)]]" on-keydown="onKeydown_"
on-blur="onBlur_" aria-labelled-by="section-title" on-blur="onBlur_" aria-label="[[inputAriaLabel]]"
error-message="[[hintMessage]]" auto-validate> error-message="[[hintMessage]]" auto-validate>
<span slot="suffix"> <span slot="suffix">
<slot name="opt-inside-content"></slot> <slot name="opt-inside-content"></slot>
......
...@@ -37,6 +37,8 @@ Polymer({ ...@@ -37,6 +37,8 @@ Polymer({
inputLabel: String, inputLabel: String,
inputAriaLabel: String,
hintMessage: String, hintMessage: String,
disabled: Boolean, disabled: Boolean,
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<cr-radio-button name="pages" id="custom-radio-button" <cr-radio-button name="pages" id="custom-radio-button"
checked$="[[customSelected_]]" checked$="[[customSelected_]]"
disabled$="[[getDisabled_(disabled)]]" disabled$="[[getDisabled_(disabled)]]"
aria-label="$i18n{optionCustomPages}"
on-click="onCustomRadioClick_"> on-click="onCustomRadioClick_">
<cr-input id="pageSettingsCustomInput" type="text" <cr-input id="pageSettingsCustomInput" type="text"
data-timeout-delay="500" data-timeout-delay="500"
...@@ -54,7 +55,6 @@ ...@@ -54,7 +55,6 @@
pattern="[[inputPattern_]]" pattern="[[inputPattern_]]"
on-focus="onCustomInputFocus_" on-blur="onCustomInputBlur_" on-focus="onCustomInputFocus_" on-blur="onCustomInputBlur_"
placeholder="$i18n{examplePageRangeText}" placeholder="$i18n{examplePageRangeText}"
aria-label="$i18n{examplePageRangeText}"
error-message="[[getHintMessage_(errorState_, error-message="[[getHintMessage_(errorState_,
documentInfo.pageCount)]]" documentInfo.pageCount)]]"
auto-validate> auto-validate>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</div> </div>
</print-preview-settings-section> </print-preview-settings-section>
<print-preview-number-settings-section max-value="200" min-value="10" <print-preview-number-settings-section max-value="200" min-value="10"
default-value="100" default-value="100" input-aria-label="$i18n{scalingLabel}"
input-label="[[getScalingInputLabel_(settings.fitToPage.available)]]" input-label="[[getScalingInputLabel_(settings.fitToPage.available)]]"
disabled="[[disabled]]" current-value="{{currentValue_}}" disabled="[[disabled]]" current-value="{{currentValue_}}"
input-valid="{{inputValid_}}" hint-message="$i18n{scalingInstruction}"> input-valid="{{inputValid_}}" hint-message="$i18n{scalingInstruction}">
......
...@@ -201,6 +201,8 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { ...@@ -201,6 +201,8 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) {
source->AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL); source->AddLocalizedString("layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL);
source->AddLocalizedString("optionAllPages", source->AddLocalizedString("optionAllPages",
IDS_PRINT_PREVIEW_OPTION_ALL_PAGES); IDS_PRINT_PREVIEW_OPTION_ALL_PAGES);
source->AddLocalizedString("optionCustomPages",
IDS_PRINT_PREVIEW_OPTION_CUSTOM_PAGES);
source->AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW); source->AddLocalizedString("optionBw", IDS_PRINT_PREVIEW_OPTION_BW);
source->AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE); source->AddLocalizedString("optionCollate", IDS_PRINT_PREVIEW_OPTION_COLLATE);
source->AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR); source->AddLocalizedString("optionColor", IDS_PRINT_PREVIEW_OPTION_COLOR);
......
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