Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: Source/modules/accessibility/AXScrollView.cpp

Issue 1076453004: Show reasons why nodes are ignored in accessibility sidebar (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return scrollBarObject; 137 return scrollBarObject;
138 } 138 }
139 139
140 void AXScrollView::clearChildren() 140 void AXScrollView::clearChildren()
141 { 141 {
142 AXObject::clearChildren(); 142 AXObject::clearChildren();
143 m_verticalScrollbar = nullptr; 143 m_verticalScrollbar = nullptr;
144 m_horizontalScrollbar = nullptr; 144 m_horizontalScrollbar = nullptr;
145 } 145 }
146 146
147 bool AXScrollView::computeAccessibilityIsIgnored() const 147 bool AXScrollView::computeAccessibilityIsIgnored(PassRefPtr<TypeBuilder::Array<T ypeBuilder::Accessibility::AXProperty>> ignoredReasons) const
148 { 148 {
149 // We just want to match whatever's returned by our web area, which is a chi ld of this 149 // We just want to match whatever's returned by our web area, which is a chi ld of this
150 // object. Normally cached attribute values may only search up the tree. We can't just 150 // object. Normally cached attribute values may only search up the tree. We can't just
151 // call accessibilityIsIgnored on the web area, because the web area may sea rch up its 151 // call accessibilityIsIgnored on the web area, because the web area may sea rch up its
152 // ancestors and call this function recursively, and we'd loop until a stack overflow. 152 // ancestors and call this function recursively, and we'd loop until a stack overflow.
153 153
154 // Instead, we first update the cached accessibilityIsIgnored value for this node to 154 // Instead, we first update the cached accessibilityIsIgnored value for this node to
155 // false, call accessibilityIsIgnored on the web area, then return the mathc ing value. 155 // false, call accessibilityIsIgnored on the web area, then return the mathc ing value.
156 m_cachedIsIgnored = false; 156 m_cachedIsIgnored = false;
157 m_lastModificationCount = axObjectCache()->modificationCount(); 157 m_lastModificationCount = axObjectCache()->modificationCount();
158 158
159 AXObject* webArea = webAreaObject(); 159 AXObject* webArea = webAreaObject();
160 if (webArea) 160 if (!webArea)
161 return webArea->accessibilityIsIgnored(); 161 return true;
162 162
163 return true; 163 if (ignoredReasons)
164 return webArea->computeAccessibilityIsIgnored(ignoredReasons);
165
166 return webArea->accessibilityIsIgnored();
164 } 167 }
165 168
166 void AXScrollView::addChildren() 169 void AXScrollView::addChildren()
167 { 170 {
168 ASSERT(!m_haveChildren); 171 ASSERT(!m_haveChildren);
169 m_haveChildren = true; 172 m_haveChildren = true;
170 173
171 AXObject* webArea = webAreaObject(); 174 AXObject* webArea = webAreaObject();
172 if (webArea && !webArea->accessibilityIsIgnored()) 175 if (webArea && !webArea->accessibilityIsIgnored())
173 m_children.append(webArea); 176 m_children.append(webArea);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 return m_scrollView; 250 return m_scrollView;
248 } 251 }
249 252
250 void AXScrollView::scrollTo(const IntPoint& point) const 253 void AXScrollView::scrollTo(const IntPoint& point) const
251 { 254 {
252 if (m_scrollView) 255 if (m_scrollView)
253 m_scrollView->setScrollPosition(point); 256 m_scrollView->setScrollPosition(point);
254 } 257 }
255 258
256 } // namespace blink 259 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698