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

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

Issue 2390783006: [DevTools] Accessibility: Show siblings and children of selected node (Closed)
Patch Set: Ready for a first look Created 4 years, 2 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 AXObject* AXObjectCacheImpl::getOrCreate(Node* node) { 344 AXObject* AXObjectCacheImpl::getOrCreate(Node* node) {
345 if (!node) 345 if (!node)
346 return 0; 346 return 0;
347 347
348 if (AXObject* obj = get(node)) 348 if (AXObject* obj = get(node))
349 return obj; 349 return obj;
350 350
351 // If the node has a layout object, prefer using that as the primary key for 351 // If the node has a layout object, prefer using that as the primary key for
352 // the AXObject, with the exception of an HTMLAreaElement, which is created 352 // the AXObject, with the exception of an HTMLAreaElement, which is created
353 // based on its node. 353 // based on its node.
354 if (node->layoutObject() && !isHTMLAreaElement(node)) 354 if (node->layoutObject() && !isHTMLAreaElement(node)) {
355 return getOrCreate(node->layoutObject()); 355 return getOrCreate(node->layoutObject());
356 }
356 357
357 if (!node->parentElement()) 358 if (!node->parentElement()) {
358 return 0; 359 return 0;
360 }
359 361
360 if (isHTMLHeadElement(node)) 362 if (isHTMLHeadElement(node))
361 return 0; 363 return 0;
362 364
363 AXObject* newObj = createFromNode(node); 365 AXObject* newObj = createFromNode(node);
364 366
365 // Will crash later if we have two objects for the same node. 367 // Will crash later if we have two objects for the same node.
366 ASSERT(!get(node)); 368 ASSERT(!get(node));
367 369
368 getAXID(newObj); 370 getAXID(newObj);
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 visitor->trace(m_document); 1255 visitor->trace(m_document);
1254 visitor->trace(m_nodeObjectMapping); 1256 visitor->trace(m_nodeObjectMapping);
1255 1257
1256 visitor->trace(m_objects); 1258 visitor->trace(m_objects);
1257 visitor->trace(m_notificationsToPost); 1259 visitor->trace(m_notificationsToPost);
1258 1260
1259 AXObjectCache::trace(visitor); 1261 AXObjectCache::trace(visitor);
1260 } 1262 }
1261 1263
1262 } // namespace blink 1264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698