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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1841333002: Various fixes for aria-activedescendant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added selectable and selected states to ARIA list box options. Created 4 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) 2014, Google Inc. All rights reserved. 2 * Copyright (C) 2014, Google 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (toAXImageMapLink(child)->areaElement() == areaElement) 148 if (toAXImageMapLink(child)->areaElement() == areaElement)
149 return child; 149 return child;
150 } 150 }
151 151
152 return 0; 152 return 0;
153 } 153 }
154 154
155 AXObject* AXObjectCacheImpl::focusedObject() 155 AXObject* AXObjectCacheImpl::focusedObject()
156 { 156 {
157 if (!accessibilityEnabled()) 157 if (!accessibilityEnabled())
158 return 0; 158 return nullptr;
159 159
160 Node* focusedNode = m_document->focusedElement(); 160 Node* focusedNode = m_document->focusedElement();
161 if (!focusedNode) 161 if (!focusedNode)
162 focusedNode = m_document; 162 focusedNode = m_document;
163 163
164 // If it's an image map, get the focused link within the image map. 164 // If it's an image map, get the focused link within the image map.
165 if (isHTMLAreaElement(focusedNode)) 165 if (isHTMLAreaElement(focusedNode))
166 return focusedImageMapUIElement(toHTMLAreaElement(focusedNode)); 166 return focusedImageMapUIElement(toHTMLAreaElement(focusedNode));
167 167
168 // See if there's a page popup, for example a calendar picker. 168 // See if there's a page popup, for example a calendar picker.
169 Element* adjustedFocusedElement = m_document->adjustedFocusedElement(); 169 Element* adjustedFocusedElement = m_document->adjustedFocusedElement();
170 if (isHTMLInputElement(adjustedFocusedElement)) { 170 if (isHTMLInputElement(adjustedFocusedElement)) {
171 if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popu pRootAXObject()) { 171 if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popu pRootAXObject()) {
172 if (Element* focusedElementInPopup = axPopup->getDocument()->focused Element()) 172 if (Element* focusedElementInPopup = axPopup->getDocument()->focused Element())
173 focusedNode = focusedElementInPopup; 173 focusedNode = focusedElementInPopup;
174 } 174 }
175
176 } 175 }
177 176
178 AXObject* obj = getOrCreate(focusedNode); 177 AXObject* obj = getOrCreate(focusedNode);
179 if (!obj) 178 if (!obj)
180 return 0; 179 return nullptr;
181 180
182 if (obj->shouldFocusActiveDescendant()) { 181 if (obj->supportsActiveDescendant()) {
dmazzoni 2016/03/31 05:48:30 Hmmm, this code makes it seem like we were already
183 if (AXObject* descendant = obj->activeDescendant()) 182 if (AXObject* descendant = obj->activeDescendant())
184 obj = descendant; 183 obj = descendant;
185 } 184 }
186 185
187 // the HTML element, for example, is focusable but has an AX object that is ignored 186 // the HTML element, for example, is focusable but has an AX object that is ignored
188 if (obj->accessibilityIsIgnored()) 187 if (obj->accessibilityIsIgnored())
189 obj = obj->parentObjectUnignored(); 188 obj = obj->parentObjectUnignored();
190 189
191 return obj; 190 return obj;
192 } 191 }
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 visitor->trace(m_nodeObjectMapping); 1288 visitor->trace(m_nodeObjectMapping);
1290 #endif 1289 #endif
1291 1290
1292 visitor->trace(m_objects); 1291 visitor->trace(m_objects);
1293 visitor->trace(m_notificationsToPost); 1292 visitor->trace(m_notificationsToPost);
1294 1293
1295 AXObjectCache::trace(visitor); 1294 AXObjectCache::trace(visitor);
1296 } 1295 }
1297 1296
1298 } // namespace blink 1297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698