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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index 58b6cd37e5ce8175a7e970004de4385f78d8dd0f..03ed0b61c7e12905854f2c0e98c30666b1f29701 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -2259,10 +2259,12 @@ String AXNodeObject::nativeTextAlternative(
++labelIndex) {
Element* label = labels->item(labelIndex);
if (nameSources) {
- if (label->getAttribute(forAttr) == htmlElement->getIdAttribute())
+ if (!label->getAttribute(forAttr).isEmpty() &&
+ label->getAttribute(forAttr) == htmlElement->getIdAttribute()) {
nameSources->back().nativeSource = AXTextFromNativeHTMLLabelFor;
- else
+ } else {
nameSources->back().nativeSource = AXTextFromNativeHTMLLabelWrapped;
+ }
}
labelElements.push_back(label);
}
« 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