New issue
Advanced search Search tips

Issue 668569 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 3
Type: Bug
Team-Accessibility



Sign in to add a comment

AXNodeData state flags are all set by default

Project Member Reported by patricia...@chromium.org, Nov 25 2016

Issue description

Version: Since https://chromium.googlesource.com/chromium/src/+/4b02bbca3c52f2556078aa3dcb48fdc8a34136be
OS: All views platforms

What steps will reproduce the problem?
(1) Create a new AXNodeData().
(2) Call ToString() on it.

What is the expected result?
Nothing is set by default. Flags are added manually.

What happens instead?
All the flags are set. All the possible state flags are printed as per this string:

id=-1 button BUSY CHECKED COLLAPSED EDITABLE EXPANDED FOCUSABLE HASPOPUP HOVERED INVISIBLE LINKED MULTISELECTABLE OFFSCREEN PRESSED PROTECTED READONLY REQUIRED RICHLY_EDITABLE SELECTABLE SELECTED VERTICAL VISITED (0, 0)-(0, 0) name=Cancel

The above was called on a views::LabelButton used for 'cancelling' a dialog.

 
Looks like this is caused by the AXNodeData initialising its |state| member to 0xFFFFFF (-1 before that, which existed since ax_node_data.cc was first created). dmazzoni, could you shed some light on this?

It seems to me like instead of 0xFFFFFF |state| should be initialised to 0x000000, but not sure if there is a particular reason why things were this way.

I came across this because buttons, which don't set any state flags, will still be using the default |state| when GetAccessibleNodeData() is called on them, and all those flags are set as above.

Comment 2 by dmazzoni@google.com, Nov 25 2016

Thanks for catching this.

We initialized the state flags to -1 by default in order to catch bugs where they weren't set at all. The intent is that they're supposed to be cleared to zero before setting them.

What's supposed to be happening is that AXNodeData.state should be set to zero before calling GetAccessibleNodeData, like in native_view_accessibility.cc:65.

We're probably missing something similar somewhere, can you figure out where?

Ah, if that's the case, it would be my mistake. I'd been printing debug messages for a separate view to |view_| on NativeViewAccessibility and had created my own AXNodeData to print - obviously I hadn't cleared the state to 0 first. I did see native_view_accessibility.cc:65 as well, but thought it shouldn't be necessary.

Thanks for the clarification! I'll add a comment to ax_node_data.cc make it clearer, if that's OK with you.
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 29 2016

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

commit 2f4e229335d9aa02d6a90307537fef92ba8be091
Author: patricialor <patricialor@chromium.org>
Date: Tue Nov 29 17:24:29 2016

Views a11y: Add comment to explain usage of AXNodeData's |state| member.

AXNodeData::state is a bitmask used for setting accessible state flags such as
ui::AX_STATE_DISABLED. It is initialised to 0xFFFFFF, which turns all flags on.
This is done in order to more easily catch bugs where no flags are set at all -
it must be cleared to 0x0 before use. Add a comment explaining this.

BUG= 668569 

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

[modify] https://crrev.com/2f4e229335d9aa02d6a90307537fef92ba8be091/ui/accessibility/ax_node_data.cc

Status: WontFix (was: Assigned)
WAI, added a comment to explain this.

Sign in to add a comment