Chromium Code Reviews| Index: ui/views/accessibility/native_view_accessibility.cc |
| diff --git a/ui/views/accessibility/native_view_accessibility.cc b/ui/views/accessibility/native_view_accessibility.cc |
| index 7c960348478b020d7b0bfeed5adf0f50f45e5d70..7d0910f100a9f9983518231221015cd910547ae4 100644 |
| --- a/ui/views/accessibility/native_view_accessibility.cc |
| +++ b/ui/views/accessibility/native_view_accessibility.cc |
| @@ -13,6 +13,21 @@ |
| namespace views { |
| +namespace { |
| + |
| +// Determine a View's visibility accounting for potentially invisible ancestors, |
| +// since View::visible() won't return true for descendants of invisible Views. |
| +bool IsViewVisible(View* view) { |
| + while (view) { |
|
karandeepb
2016/12/28 10:59:59
Also a visible view with no parent would return tr
Patti Lor
2016/12/29 00:57:56
This was fixed when replacing this method with IsD
|
| + if (!view->visible()) |
| + return false; |
| + view = view->parent(); |
| + } |
| + return true; |
| +} |
| + |
| +} // namespace |
| + |
| #if !defined(PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL) |
| // static |
| NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { |
| @@ -85,7 +100,7 @@ const ui::AXNodeData& NativeViewAccessibility::GetData() { |
| if (!view_->enabled()) |
| data_.state |= (1 << ui::AX_STATE_DISABLED); |
| - if (!view_->visible()) |
| + if (!IsViewVisible(view_)) |
|
karandeepb
2016/12/28 10:57:10
It seems to me that View::IsDrawn accomplishes the
Patti Lor
2016/12/29 00:57:56
Oops, you're totally right. Thanks for pointing it
|
| data_.state |= (1 << ui::AX_STATE_INVISIBLE); |
| return data_; |