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

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

Issue 1050533002: Slightly upgrade caching of descendant of barren parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 424 }
425 425
426 bool AXObject::isDescendantOfBarrenParent() const 426 bool AXObject::isDescendantOfBarrenParent() const
427 { 427 {
428 updateCachedAttributeValuesIfNeeded(); 428 updateCachedAttributeValuesIfNeeded();
429 return m_cachedIsDescendantOfBarrenParent; 429 return m_cachedIsDescendantOfBarrenParent;
430 } 430 }
431 431
432 bool AXObject::computeIsDescendantOfBarrenParent() const 432 bool AXObject::computeIsDescendantOfBarrenParent() const
433 { 433 {
434 for (AXObject* object = parentObject(); object; object = object->parentObjec t()) { 434 if (AXObject* parent = parentObject()) {
435 if (!object->canHaveChildren()) 435 if (!parent->canHaveChildren())
436 return true; 436 return true;
437
438 return parent->isDescendantOfBarrenParent();
437 } 439 }
438 440
439 return false; 441 return false;
440 } 442 }
441 443
442 const AXObject* AXObject::ariaHiddenRoot() const 444 const AXObject* AXObject::ariaHiddenRoot() const
443 { 445 {
444 for (const AXObject* object = this; object; object = object->parentObject()) { 446 for (const AXObject* object = this; object; object = object->parentObject()) {
445 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) 447 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
446 return object; 448 return object;
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 } 1145 }
1144 1146
1145 const AtomicString& AXObject::roleName(AccessibilityRole role) 1147 const AtomicString& AXObject::roleName(AccessibilityRole role)
1146 { 1148 {
1147 static const Vector<AtomicString>* roleNameVector = createRoleNameVector(); 1149 static const Vector<AtomicString>* roleNameVector = createRoleNameVector();
1148 1150
1149 return roleNameVector->at(role); 1151 return roleNameVector->at(role);
1150 } 1152 }
1151 1153
1152 } // namespace blink 1154 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698