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

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

Issue 1012663002: Aria disabled does not apply to descendant elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed methods names to ..DisabledNode() 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 | « Source/modules/accessibility/AXObject.h ('k') | 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 : m_id(0) 229 : m_id(0)
230 , m_haveChildren(false) 230 , m_haveChildren(false)
231 , m_role(UnknownRole) 231 , m_role(UnknownRole)
232 , m_lastKnownIsIgnoredValue(DefaultBehavior) 232 , m_lastKnownIsIgnoredValue(DefaultBehavior)
233 , m_detached(false) 233 , m_detached(false)
234 , m_parent(0) 234 , m_parent(0)
235 , m_lastModificationCount(-1) 235 , m_lastModificationCount(-1)
236 , m_cachedIsIgnored(false) 236 , m_cachedIsIgnored(false)
237 , m_cachedIsInertOrAriaHidden(false) 237 , m_cachedIsInertOrAriaHidden(false)
238 , m_cachedIsDescendantOfBarrenParent(false) 238 , m_cachedIsDescendantOfBarrenParent(false)
239 , m_cachedIsDescendantOfDisabledNode(false)
239 , m_cachedLiveRegionRoot(0) 240 , m_cachedLiveRegionRoot(0)
240 , m_axObjectCache(axObjectCache) 241 , m_axObjectCache(axObjectCache)
241 { 242 {
242 } 243 }
243 244
244 AXObject::~AXObject() 245 AXObject::~AXObject()
245 { 246 {
246 ASSERT(isDetached()); 247 ASSERT(isDetached());
247 } 248 }
248 249
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 AXObjectCacheImpl* cache = axObjectCache(); 365 AXObjectCacheImpl* cache = axObjectCache();
365 if (!cache) 366 if (!cache)
366 return; 367 return;
367 368
368 if (cache->modificationCount() == m_lastModificationCount) 369 if (cache->modificationCount() == m_lastModificationCount)
369 return; 370 return;
370 371
371 m_lastModificationCount = cache->modificationCount(); 372 m_lastModificationCount = cache->modificationCount();
372 m_cachedIsInertOrAriaHidden = computeIsInertOrAriaHidden(); 373 m_cachedIsInertOrAriaHidden = computeIsInertOrAriaHidden();
373 m_cachedIsDescendantOfBarrenParent = computeIsDescendantOfBarrenParent(); 374 m_cachedIsDescendantOfBarrenParent = computeIsDescendantOfBarrenParent();
375 m_cachedIsDescendantOfDisabledNode = computeIsDescendantOfDisabledNode();
374 m_cachedIsIgnored = computeAccessibilityIsIgnored(); 376 m_cachedIsIgnored = computeAccessibilityIsIgnored();
375 m_cachedLiveRegionRoot = isLiveRegion() ? 377 m_cachedLiveRegionRoot = isLiveRegion() ?
376 this : 378 this :
377 (parentObjectIfExists() ? parentObjectIfExists()->liveRegionRoot() : 0); 379 (parentObjectIfExists() ? parentObjectIfExists()->liveRegionRoot() : 0);
378 } 380 }
379 381
380 bool AXObject::accessibilityIsIgnoredByDefault() const 382 bool AXObject::accessibilityIsIgnoredByDefault() const
381 { 383 {
382 return defaultObjectInclusion() == IgnoreObject; 384 return defaultObjectInclusion() == IgnoreObject;
383 } 385 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 const AXObject* AXObject::ariaHiddenRoot() const 442 const AXObject* AXObject::ariaHiddenRoot() const
441 { 443 {
442 for (const AXObject* object = this; object; object = object->parentObject()) { 444 for (const AXObject* object = this; object; object = object->parentObject()) {
443 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) 445 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
444 return object; 446 return object;
445 } 447 }
446 448
447 return 0; 449 return 0;
448 } 450 }
449 451
452 bool AXObject::isDescendantOfDisabledNode() const
453 {
454 updateCachedAttributeValuesIfNeeded();
455 return m_cachedIsDescendantOfDisabledNode;
456 }
457
458 bool AXObject::computeIsDescendantOfDisabledNode() const
459 {
460 const AtomicString& disabled = getAttribute(aria_disabledAttr);
461 if (equalIgnoringCase(disabled, "true"))
462 return true;
463 if (equalIgnoringCase(disabled, "false"))
464 return false;
465
466 if (AXObject* parent = parentObject())
467 return parent->isDescendantOfDisabledNode();
468
469 return false;
470 }
471
450 bool AXObject::lastKnownIsIgnoredValue() 472 bool AXObject::lastKnownIsIgnoredValue()
451 { 473 {
452 if (m_lastKnownIsIgnoredValue == DefaultBehavior) 474 if (m_lastKnownIsIgnoredValue == DefaultBehavior)
453 m_lastKnownIsIgnoredValue = accessibilityIsIgnored() ? IgnoreObject : In cludeObject; 475 m_lastKnownIsIgnoredValue = accessibilityIsIgnored() ? IgnoreObject : In cludeObject;
454 476
455 return m_lastKnownIsIgnoredValue == IgnoreObject; 477 return m_lastKnownIsIgnoredValue == IgnoreObject;
456 } 478 }
457 479
458 void AXObject::setLastKnownIsIgnoredValue(bool isIgnored) 480 void AXObject::setLastKnownIsIgnoredValue(bool isIgnored)
459 { 481 {
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1143 }
1122 1144
1123 const AtomicString& AXObject::roleName(AccessibilityRole role) 1145 const AtomicString& AXObject::roleName(AccessibilityRole role)
1124 { 1146 {
1125 static const Vector<AtomicString>* roleNameVector = createRoleNameVector(); 1147 static const Vector<AtomicString>* roleNameVector = createRoleNameVector();
1126 1148
1127 return roleNameVector->at(role); 1149 return roleNameVector->at(role);
1128 } 1150 }
1129 1151
1130 } // namespace blink 1152 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698