New issue
Advanced search Search tips

Issue 811293 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug
Team-Accessibility



Sign in to add a comment

Useful accessibility violation error messages to pinpoint the source of the issue

Project Member Reported by aleventhal@chromium.org, Feb 12 2018

Issue description

When accessibility_checks violations occur, they currently provide the view class of the incorrect view as well as its ancestors. This is useful, but often not enough.

For example, the following error message does not really help show which combobox is broken:
View violates ViewHierarchyHasAccessibilityErrors():
RootView > ui/views/window/NonClientView > ui/views/window/ClientView > View > View > View > View > views/Combobox (id 0)
- Focusable View has no accessible name or placeholder, and the name attribute does not use kAttributeExplicitlyEmpty.

A better error message would include the stack trace showing how the view was created in the first place, for example, the following error message shows exactly that the errant view was created by CardUnmaskPromptViews:

View violates ViewHierarchyHasAccessibilityErrors():
RootView > ui/views/window/NonClientView > ui/views/window/ClientView > View > View > View > View > views/Combobox (id 0)
- Focusable View has no accessible name or placeholder, and the name attribute does not use kAttributeExplicitlyEmpty.

The following stack created the inaccessible View:
#0 0x7fbff239554c base::debug::StackTrace::StackTrace()
#1 0x7fbff0236db4 views::View::View()
#2 0x7fbff01da08f views::Combobox::Combobox()
#3 0x000003cf525c autofill::CardUnmaskPromptViews::InitIfNecessary()
#4 0x000003cf5672 autofill::CardUnmaskPromptViews::GetContentsView()
#5 0x7fbff0247bb0 views::Widget::Init()
#6 0x7fbff02519fd views::DialogDelegate::CreateDialogWidget()
#7 0x000003f005db constrained_window::CreateWebModalDialogViews()
#8 0x000003f00493 constrained_window::ShowWebModalDialogViews()
#9 0x0000033b7ac3 autofill::CardUnmaskPromptControllerImpl::ShowPrompt()
#10 0x00000184e4da autofill::(anonymous namespace)::CardUnmaskPromptViewBrowserTest::ShowUi()
#11 0x00000184ef66 autofill::(anonymous namespace)::CardUnmaskPromptViewBrowserTest_DisplayUI_Test::RunTestOnMainThread()
#12 0x000002e5a2bf content::BrowserTestBase::ProxyRunTestOnMainThreadLoop()

 
Labels: -Pri-2 Pri-1
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 24 2018

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

commit a1995611a76c01a968e3cbc1c8e5673fa4f8804d
Author: Aaron Leventhal <aleventhal@chromium.org>
Date: Tue Apr 24 21:42:22 2018

Instructions getting stack of errant view's construction

When a view fails an accessibility check, it can be very helpful to find
out what line of code constructed it. This provides information on how
to patch in code that does that.

We may want to build this in at some point:
See https://crrev.com/c/1025637 or https://crrev.com/c/963284.

Bug: 811293
Change-Id: I14046d7d40a5475e28691d371acdcb6538b66663
Reviewed-on: https://chromium-review.googlesource.com/1026055
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553295}
[modify] https://crrev.com/a1995611a76c01a968e3cbc1c8e5673fa4f8804d/chrome/test/views/accessibility_checker.cc

Sign in to add a comment