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

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

Issue 2630323004: [Devtools] Accessibility pane: correctly show label text source (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityNodeView.js ('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 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 nameSources->back().nativeSource = AXTextFromNativeHTMLLabel; 2252 nameSources->back().nativeSource = AXTextFromNativeHTMLLabel;
2253 } 2253 }
2254 2254
2255 LabelsNodeList* labels = toLabelableElement(htmlElement)->labels(); 2255 LabelsNodeList* labels = toLabelableElement(htmlElement)->labels();
2256 if (labels && labels->length() > 0) { 2256 if (labels && labels->length() > 0) {
2257 HeapVector<Member<Element>> labelElements; 2257 HeapVector<Member<Element>> labelElements;
2258 for (unsigned labelIndex = 0; labelIndex < labels->length(); 2258 for (unsigned labelIndex = 0; labelIndex < labels->length();
2259 ++labelIndex) { 2259 ++labelIndex) {
2260 Element* label = labels->item(labelIndex); 2260 Element* label = labels->item(labelIndex);
2261 if (nameSources) { 2261 if (nameSources) {
2262 if (label->getAttribute(forAttr) == htmlElement->getIdAttribute()) 2262 if (!label->getAttribute(forAttr).isEmpty() &&
2263 label->getAttribute(forAttr) == htmlElement->getIdAttribute()) {
2263 nameSources->back().nativeSource = AXTextFromNativeHTMLLabelFor; 2264 nameSources->back().nativeSource = AXTextFromNativeHTMLLabelFor;
2264 else 2265 } else {
2265 nameSources->back().nativeSource = AXTextFromNativeHTMLLabelWrapped; 2266 nameSources->back().nativeSource = AXTextFromNativeHTMLLabelWrapped;
2267 }
2266 } 2268 }
2267 labelElements.push_back(label); 2269 labelElements.push_back(label);
2268 } 2270 }
2269 2271
2270 textAlternative = 2272 textAlternative =
2271 textFromElements(false, visited, labelElements, relatedObjects); 2273 textFromElements(false, visited, labelElements, relatedObjects);
2272 if (!textAlternative.isNull()) { 2274 if (!textAlternative.isNull()) {
2273 *foundTextAlternative = true; 2275 *foundTextAlternative = true;
2274 if (nameSources) { 2276 if (nameSources) {
2275 NameSource& source = nameSources->back(); 2277 NameSource& source = nameSources->back();
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2895 return String(); 2897 return String();
2896 return toTextControlElement(node)->strippedPlaceholder(); 2898 return toTextControlElement(node)->strippedPlaceholder();
2897 } 2899 }
2898 2900
2899 DEFINE_TRACE(AXNodeObject) { 2901 DEFINE_TRACE(AXNodeObject) {
2900 visitor->trace(m_node); 2902 visitor->trace(m_node);
2901 AXObject::trace(visitor); 2903 AXObject::trace(visitor);
2902 } 2904 }
2903 2905
2904 } // namespace blink 2906 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityNodeView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698