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

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

Issue 1435113003: Make use of new AX name calc in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue with ariaTextAlternative Created 5 years, 1 month 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 return AXObject::roleName(UnknownRole); 1306 return AXObject::roleName(UnknownRole);
1307 return AXObject::roleName(obj->roleValue()); 1307 return AXObject::roleName(obj->roleValue());
1308 } 1308 }
1309 1309
1310 String AXObjectCacheImpl::computedNameForNode(Node* node) 1310 String AXObjectCacheImpl::computedNameForNode(Node* node)
1311 { 1311 {
1312 AXObject* obj = getOrCreate(node); 1312 AXObject* obj = getOrCreate(node);
1313 if (!obj) 1313 if (!obj)
1314 return ""; 1314 return "";
1315 1315
1316 String title = obj->deprecatedTitle(); 1316 return obj->computedName();
1317
1318 String titleUIText;
1319 if (title.isEmpty()) {
1320 AXObject* titleUIElement = obj->deprecatedTitleUIElement();
1321 if (titleUIElement) {
1322 titleUIText = titleUIElement->deprecatedTextUnderElement();
1323 if (!titleUIText.isEmpty())
1324 return titleUIText;
1325 }
1326 }
1327
1328 String description = obj->deprecatedAccessibilityDescription();
1329 if (!description.isEmpty())
1330 return description;
1331
1332 if (!title.isEmpty())
1333 return title;
1334
1335 String placeholder;
1336 if (isHTMLInputElement(node)) {
1337 HTMLInputElement* element = toHTMLInputElement(node);
1338 placeholder = element->strippedPlaceholder();
1339 if (!placeholder.isEmpty())
1340 return placeholder;
1341 }
1342
1343 return String();
1344 } 1317 }
1345 1318
1346 void AXObjectCacheImpl::onTouchAccessibilityHover(const IntPoint& location) 1319 void AXObjectCacheImpl::onTouchAccessibilityHover(const IntPoint& location)
1347 { 1320 {
1348 AXObject* hit = root()->accessibilityHitTest(location); 1321 AXObject* hit = root()->accessibilityHitTest(location);
1349 if (hit) 1322 if (hit)
1350 postPlatformNotification(hit, AXHover); 1323 postPlatformNotification(hit, AXHover);
1351 } 1324 }
1352 1325
1353 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) 1326 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect)
(...skipping 13 matching lines...) Expand all
1367 visitor->trace(m_nodeObjectMapping); 1340 visitor->trace(m_nodeObjectMapping);
1368 #endif 1341 #endif
1369 1342
1370 visitor->trace(m_objects); 1343 visitor->trace(m_objects);
1371 visitor->trace(m_notificationsToPost); 1344 visitor->trace(m_notificationsToPost);
1372 1345
1373 AXObjectCache::trace(visitor); 1346 AXObjectCache::trace(visitor);
1374 } 1347 }
1375 1348
1376 } // namespace blink 1349 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698