AXNodeData state flags are all set by default |
||
Issue descriptionVersion: 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.
,
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?
,
Nov 25 2016
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.
,
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
,
Dec 1 2016
WAI, added a comment to explain this. |
||
►
Sign in to add a comment |
||
Comment 1 by patricia...@chromium.org
, Nov 25 2016