Commit bf75a4f2 authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Improve accessible markup of OOBE network drop-down.

BUG=161880
TBR=nkostylev

Review URL: https://codereview.chromium.org/11428124

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170977 0039d316-1c4b-4281-b951-d872f2087c98
parent 882db44a
...@@ -93,13 +93,16 @@ cr.define('cr.ui', function() { ...@@ -93,13 +93,16 @@ cr.define('cr.ui', function() {
decorate: function() { decorate: function() {
this.appendChild(this.createOverlay_()); this.appendChild(this.createOverlay_());
this.appendChild(this.title_ = this.createTitle_()); this.appendChild(this.title_ = this.createTitle_());
this.appendChild(new DropDownContainer()); var container = new DropDownContainer();
container.id = this.id + '-dropdown-container';
this.appendChild(container);
this.addEventListener('keydown', this.keyDownHandler_); this.addEventListener('keydown', this.keyDownHandler_);
this.title_.id = this.id + '-dropdown'; this.title_.id = this.id + '-dropdown';
this.title_.setAttribute('role', 'button'); this.title_.setAttribute('role', 'button');
this.title_.setAttribute('aria-haspopup', 'true'); this.title_.setAttribute('aria-haspopup', 'true');
this.title_.setAttribute('aria-owns', container.id);
}, },
/** /**
...@@ -119,9 +122,7 @@ cr.define('cr.ui', function() { ...@@ -119,9 +122,7 @@ cr.define('cr.ui', function() {
this.container.hidden = !show; this.container.hidden = !show;
if (show) { if (show) {
this.container.selectItem(this.container.firstItem, false); this.container.selectItem(this.container.firstItem, false);
this.title_.setAttribute('aria-pressed', 'true');
} else { } else {
this.title_.setAttribute('aria-pressed', 'false');
this.title_.removeAttribute('aria-activedescendant'); this.title_.removeAttribute('aria-activedescendant');
} }
}, },
......
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