New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 634063 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug
Team-Accessibility



Sign in to add a comment

WebUI: IDs of list items are not set

Project Member Reported by nek...@chromium.org, Aug 3 2016

Issue description

When using the JS implementation of listbox from the Web UI, such as on internal pages, the list items don't get an ID. As a result, aria-activedescendant on the listbox is always the empty string.
ui/webui/resources/js/cr/ui/list.js
<snippet>
    /**
     * Creates a new list item.
     * @param {?} value The value to use for the item.
     * @return {!cr.ui.ListItem} The newly created list item.
     */
    createItem: function(value) {
      var item = new this.itemConstructor_(value);
      item.label = value;
// The following line doesn't seem to work.
      item.id = this.uniqueIdPrefix_ + '-' + this.nextUniqueIdSuffix_++;
      if (typeof item.decorate == 'function')
        item.decorate();
      return item;
    },
</snippet>

 
Components: UI>Accessibility UI>Browser>WebUI
Labels: -Pri-3 Pri-2
Owner: dbeam@chromium.org
Dan, could you look at this?

Comment 2 by dbeam@chromium.org, Aug 3 2016

which page is in this on?

Comment 3 by dbeam@chromium.org, Aug 3 2016

which page is this on?**

we're not planning to reuse ui/webui/resources/js/cr/ui/list.js in new code, as far as I know.  if this is also on basically any user-facing webui page (and it probably is), we'll be replacing them fairly soon.
chrome://bookmarks

Comment 5 by nek...@chromium.org, Aug 29 2016

How soon is this widget going to be replaced. In the next version or two, or further in the future?
Because this should be an one-line fix.

Comment 6 by dbeam@chromium.org, Aug 29 2016

bookmarks probably wont be replaced for a while.

Comment 7 by dbeam@chromium.org, Aug 29 2016

Cc: dbeam@chromium.org
Owner: nek...@chromium.org
Cc: nek...@chromium.org
Owner: dmazz...@chromium.org
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4feee4215681b9a878a85e66c1019b09803a47c7

commit 4feee4215681b9a878a85e66c1019b09803a47c7
Author: dmazzoni <dmazzoni@chromium.org>
Date: Wed Sep 21 18:50:21 2016

Give descendants of cr.ui.ListItem a unique ID to fix accessibility.

The unique ID is necessary so that aria-activedescendant can be
set on the parent list.

The unique ID was being set in List.createItem(), which was
being overriden by several subclasses, including BookmarkList.
Instead, set the unique ID in ListItem.decorate(), since
subclasses of ListItem seem to all call the inherited method.

With this change, there isn't an easy way to compute the ID
prefix once per list and share it between all of the list items.
It seems expensive to walk the parents for each new list item
created, so I opted to get rid of the custom ID prefix and
just make each one unique, since that's what really matters.

Manually tested with VoiceOver - arrowing through the bookmarks
gives proper spoken feedback.

BUG= 634063 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
TBR=fukino

Review-Url: https://codereview.chromium.org/2346393004
Cr-Commit-Position: refs/heads/master@{#420122}

[modify] https://crrev.com/4feee4215681b9a878a85e66c1019b09803a47c7/ui/file_manager/integration_tests/file_manager/create_new_folder.js
[modify] https://crrev.com/4feee4215681b9a878a85e66c1019b09803a47c7/ui/webui/resources/js/cr/ui/list.js
[modify] https://crrev.com/4feee4215681b9a878a85e66c1019b09803a47c7/ui/webui/resources/js/cr/ui/list_item.js

Status: Fixed (was: Assigned)

Sign in to add a comment