summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authoralekseys@chromium.org <alekseys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-07 10:05:57 +0000
committeralekseys@chromium.org <alekseys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-07 10:05:57 +0000
commit03774bfa2b82be4b72770ccef680204010085174 (patch)
tree90241a1e4ef56aa2d89f547938b3ff7de3432905 /chrome/browser/resources
parent41dc2271121d7fe79d6a7a38207fdcc605adc733 (diff)
downloadchromium_src-03774bfa2b82be4b72770ccef680204010085174.zip
chromium_src-03774bfa2b82be4b72770ccef680204010085174.tar.gz
chromium_src-03774bfa2b82be4b72770ccef680204010085174.tar.bz2
Hide printer selection element (instead of making it transparent) when printer selection is closed to remove it from tab order and a11y index.
BUG=338369 Review URL: https://codereview.chromium.org/133003008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249670 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/print_preview/search/destination_search.html2
-rw-r--r--chrome/browser/resources/print_preview/search/destination_search.js17
2 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/resources/print_preview/search/destination_search.html b/chrome/browser/resources/print_preview/search/destination_search.html
index fdfaaf3..312d68f 100644
--- a/chrome/browser/resources/print_preview/search/destination_search.html
+++ b/chrome/browser/resources/print_preview/search/destination_search.html
@@ -1,4 +1,4 @@
-<div id="destination-search" class="destination-search overlay transparent">
+<div id="destination-search" class="destination-search overlay transparent" hidden>
<div class="page">
<h1 i18n-content="destinationSearchTitle"></h1>
<span class="user-info" hidden></span>
diff --git a/chrome/browser/resources/print_preview/search/destination_search.js b/chrome/browser/resources/print_preview/search/destination_search.js
index f8a17c0..a0a2857 100644
--- a/chrome/browser/resources/print_preview/search/destination_search.js
+++ b/chrome/browser/resources/print_preview/search/destination_search.js
@@ -121,9 +121,15 @@ cr.define('print_preview', function() {
/** @param {boolean} isVisible Whether the component is visible. */
setIsVisible: function(isVisible) {
+ if (this.getIsVisible() == isVisible) {
+ return;
+ }
if (isVisible) {
+ setIsVisible(this.getElement(), true);
+ setTimeout(function(element) {
+ element.classList.remove('transparent');
+ }.bind(this, this.getElement()), 0);
this.searchBox_.focus();
- this.getElement().classList.remove('transparent');
var promoEl = this.getChildElement('.cloudprint-promo');
if (getIsVisible(promoEl)) {
this.metrics_.incrementDestinationSearchBucket(
@@ -166,6 +172,15 @@ cr.define('print_preview', function() {
/** @override */
enterDocument: function() {
print_preview.Component.prototype.enterDocument.call(this);
+
+ this.getElement().addEventListener('webkitTransitionEnd', function f(e) {
+ if (e.target != e.currentTarget || e.propertyName != 'opacity')
+ return;
+ if (e.target.classList.contains('transparent')) {
+ setIsVisible(e.target, false);
+ }
+ });
+
this.tracker.add(
this.getChildElement('.page > .close-button'),
'click',