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

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

Issue 836553002: Accessible name not calculated properly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 11 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 | « LayoutTests/accessibility/aria-labelledby-on-input-expected.txt ('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) 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (node->isTextNode()) 85 if (node->isTextNode())
86 return toText(node)->data(); 86 return toText(node)->data();
87 87
88 if (isHTMLInputElement(*node)) 88 if (isHTMLInputElement(*node))
89 return toHTMLInputElement(*node).value(); 89 return toHTMLInputElement(*node).value();
90 90
91 if (node->isHTMLElement()) { 91 if (node->isHTMLElement()) {
92 const AtomicString& alt = toHTMLElement(node)->getAttribute(altAttr); 92 const AtomicString& alt = toHTMLElement(node)->getAttribute(altAttr);
93 if (!alt.isEmpty()) 93 if (!alt.isEmpty())
94 return alt; 94 return alt;
95
96 const AtomicString& title = toHTMLElement(node)->getAttribute(titleAttr) ;
97 if (!title.isEmpty())
98 return title;
95 } 99 }
96 100
97 return String(); 101 return String();
98 } 102 }
99 103
100 String AXNodeObject::accessibilityDescriptionForElements(WillBeHeapVector<RawPtr WillBeMember<Element>> &elements) const 104 String AXNodeObject::accessibilityDescriptionForElements(WillBeHeapVector<RawPtr WillBeMember<Element>> &elements) const
101 { 105 {
102 StringBuilder builder; 106 StringBuilder builder;
103 unsigned size = elements.size(); 107 unsigned size = elements.size();
104 for (unsigned i = 0; i < size; ++i) { 108 for (unsigned i = 0; i < size; ++i) {
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 float range = maxValueForRange() - minValueForRange(); 1963 float range = maxValueForRange() - minValueForRange();
1960 float value = valueForRange(); 1964 float value = valueForRange();
1961 1965
1962 value += range * (percentChange / 100); 1966 value += range * (percentChange / 100);
1963 setValue(String::number(value)); 1967 setValue(String::number(value));
1964 1968
1965 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 1969 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1966 } 1970 }
1967 1971
1968 } // namespace blink 1972 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/aria-labelledby-on-input-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698