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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 *foundTextAlternative = true; 818 *foundTextAlternative = true;
819 } else { 819 } else {
820 *foundTextAlternative = true; 820 *foundTextAlternative = true;
821 return textAlternative; 821 return textAlternative;
822 } 822 }
823 } 823 }
824 824
825 return textAlternative; 825 return textAlternative;
826 } 826 }
827 827
828 String AXObject::textFromElements(bool inAriaLabelledbyTraversal, AXObjectSet& v isited, WillBeHeapVector<RawPtrWillBeMember<Element>>& elements, AXRelatedObject Vector* relatedObjects) const 828 String AXObject::textFromElements(bool inAriaLabelledbyTraversal, AXObjectSet& v isited, HeapVector<Member<Element>>& elements, AXRelatedObjectVector* relatedObj ects) const
829 { 829 {
830 StringBuilder accumulatedText; 830 StringBuilder accumulatedText;
831 bool foundValidElement = false; 831 bool foundValidElement = false;
832 AXRelatedObjectVector localRelatedObjects; 832 AXRelatedObjectVector localRelatedObjects;
833 833
834 for (const auto& element : elements) { 834 for (const auto& element : elements) {
835 AXObject* axElement = axObjectCache().getOrCreate(element); 835 AXObject* axElement = axObjectCache().getOrCreate(element);
836 if (axElement) { 836 if (axElement) {
837 foundValidElement = true; 837 foundValidElement = true;
838 838
(...skipping 20 matching lines...) Expand all
859 return; 859 return;
860 860
861 String attributeValue = getAttribute(attribute).getString(); 861 String attributeValue = getAttribute(attribute).getString();
862 if (attributeValue.isEmpty()) 862 if (attributeValue.isEmpty())
863 return; 863 return;
864 864
865 attributeValue.simplifyWhiteSpace(); 865 attributeValue.simplifyWhiteSpace();
866 attributeValue.split(' ', tokens); 866 attributeValue.split(' ', tokens);
867 } 867 }
868 868
869 void AXObject::elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element >>& elements, const QualifiedName& attribute) const 869 void AXObject::elementsFromAttribute(HeapVector<Member<Element>>& elements, cons t QualifiedName& attribute) const
870 { 870 {
871 Vector<String> ids; 871 Vector<String> ids;
872 tokenVectorFromAttribute(ids, attribute); 872 tokenVectorFromAttribute(ids, attribute);
873 if (ids.isEmpty()) 873 if (ids.isEmpty())
874 return; 874 return;
875 875
876 TreeScope& scope = getNode()->treeScope(); 876 TreeScope& scope = getNode()->treeScope();
877 for (const auto& id : ids) { 877 for (const auto& id : ids) {
878 if (Element* idElement = scope.getElementById(AtomicString(id))) 878 if (Element* idElement = scope.getElementById(AtomicString(id)))
879 elements.append(idElement); 879 elements.append(idElement);
880 } 880 }
881 } 881 }
882 882
883 void AXObject::ariaLabelledbyElementVector(WillBeHeapVector<RawPtrWillBeMember<E lement>>& elements) const 883 void AXObject::ariaLabelledbyElementVector(HeapVector<Member<Element>>& elements ) const
884 { 884 {
885 // Try both spellings, but prefer aria-labelledby, which is the official spe c. 885 // Try both spellings, but prefer aria-labelledby, which is the official spe c.
886 elementsFromAttribute(elements, aria_labelledbyAttr); 886 elementsFromAttribute(elements, aria_labelledbyAttr);
887 if (!elements.size()) 887 if (!elements.size())
888 elementsFromAttribute(elements, aria_labeledbyAttr); 888 elementsFromAttribute(elements, aria_labeledbyAttr);
889 } 889 }
890 890
891 String AXObject::textFromAriaLabelledby(AXObjectSet& visited, AXRelatedObjectVec tor* relatedObjects) const 891 String AXObject::textFromAriaLabelledby(AXObjectSet& visited, AXRelatedObjectVec tor* relatedObjects) const
892 { 892 {
893 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; 893 HeapVector<Member<Element>> elements;
894 ariaLabelledbyElementVector(elements); 894 ariaLabelledbyElementVector(elements);
895 return textFromElements(true, visited, elements, relatedObjects); 895 return textFromElements(true, visited, elements, relatedObjects);
896 } 896 }
897 897
898 String AXObject::textFromAriaDescribedby(AXRelatedObjectVector* relatedObjects) const 898 String AXObject::textFromAriaDescribedby(AXRelatedObjectVector* relatedObjects) const
899 { 899 {
900 AXObjectSet visited; 900 AXObjectSet visited;
901 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; 901 HeapVector<Member<Element>> elements;
902 elementsFromAttribute(elements, aria_describedbyAttr); 902 elementsFromAttribute(elements, aria_describedbyAttr);
903 return textFromElements(true, visited, elements, relatedObjects); 903 return textFromElements(true, visited, elements, relatedObjects);
904 } 904 }
905 905
906 AccessibilityOrientation AXObject::orientation() const 906 AccessibilityOrientation AXObject::orientation() const
907 { 907 {
908 // In ARIA 1.1, the default value for aria-orientation changed from 908 // In ARIA 1.1, the default value for aria-orientation changed from
909 // horizontal to undefined. 909 // horizontal to undefined.
910 return AccessibilityOrientationUndefined; 910 return AccessibilityOrientationUndefined;
911 } 911 }
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 1690
1691 DEFINE_TRACE(AXObject) 1691 DEFINE_TRACE(AXObject)
1692 { 1692 {
1693 visitor->trace(m_children); 1693 visitor->trace(m_children);
1694 visitor->trace(m_parent); 1694 visitor->trace(m_parent);
1695 visitor->trace(m_cachedLiveRegionRoot); 1695 visitor->trace(m_cachedLiveRegionRoot);
1696 visitor->trace(m_axObjectCache); 1696 visitor->trace(m_axObjectCache);
1697 } 1697 }
1698 1698
1699 } // namespace blink 1699 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698