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

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

Issue 2112243004: Ignores ARIA relations (e.g. aria-labelledby) that point to an invisible target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed invisible to hidden to match ARIA Implementation Guide. Created 4 years, 5 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 role = buttonRoleType(); 564 role = buttonRoleType();
565 565
566 role = remapAriaRoleDueToParent(role); 566 role = remapAriaRoleDueToParent(role);
567 567
568 if (role) 568 if (role)
569 return role; 569 return role;
570 570
571 return UnknownRole; 571 return UnknownRole;
572 } 572 }
573 573
574 void AXNodeObject::accessibilityChildrenFromAttribute(QualifiedName attr, AXObje ct::AXObjectVector& children) const 574 void AXNodeObject::accessibilityChildrenFromAttribute(QualifiedName attr, AXObje ct::AXObjectVector& children, bool includeHiddenObjects) const
575 { 575 {
576 HeapVector<Member<Element>> elements; 576 HeapVector<Member<Element>> elements;
577 elementsFromAttribute(elements, attr); 577 elementsFromAttribute(elements, attr);
578 578
579 AXObjectCacheImpl& cache = axObjectCache(); 579 AXObjectCacheImpl& cache = axObjectCache();
580 for (const auto& element : elements) { 580 for (const auto& element : elements) {
581 if (AXObject* child = cache.getOrCreate(element)) 581 if (AXObject* child = cache.getOrCreate(element)) {
582 if (!includeHiddenObjects && child->isHiddenForTextAlternativeCalcul ation())
aboxhall 2016/07/08 17:12:35 Why not just call child->accessibilityIsIgnored()
583 continue;
582 children.append(child); 584 children.append(child);
585 }
583 } 586 }
584 } 587 }
585 588
586 // This only returns true if this is the element that actually has the 589 // This only returns true if this is the element that actually has the
587 // contentEditable attribute set, unlike node->hasEditableStyle() which will 590 // contentEditable attribute set, unlike node->hasEditableStyle() which will
588 // also return true if an ancestor is editable. 591 // also return true if an ancestor is editable.
589 bool AXNodeObject::hasContentEditableAttributeSet() const 592 bool AXNodeObject::hasContentEditableAttributeSet() const
590 { 593 {
591 const AtomicString& contentEditableValue = getAttribute(contenteditableAttr) ; 594 const AtomicString& contentEditableValue = getAttribute(contenteditableAttr) ;
592 if (contentEditableValue.isNull()) 595 if (contentEditableValue.isNull())
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 return placeholder; 2836 return placeholder;
2834 } 2837 }
2835 2838
2836 DEFINE_TRACE(AXNodeObject) 2839 DEFINE_TRACE(AXNodeObject)
2837 { 2840 {
2838 visitor->trace(m_node); 2841 visitor->trace(m_node);
2839 AXObject::trace(visitor); 2842 AXObject::trace(visitor);
2840 } 2843 }
2841 2844
2842 } // namespace blink 2845 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698