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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 1467423002: Implement nameFromLabelElement to see if a control is associated with a label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@axlayoutobj_null
Patch Set: Created 5 years, 1 month 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 | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 0569076bf68a63504bd25600ff72a8c29da7c3ef..4211da11acf0809492031b81efe40418f072c00b 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -595,22 +595,17 @@ bool AXLayoutObject::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReason
// find out if this element is inside of a label element.
// if so, it may be ignored because it's the label for a checkbox or radio button
AXObject* controlObject = correspondingControlForLabelElement();
- if (controlObject && controlObject->isCheckboxOrRadio()) {
- AXNameFrom controlNameFrom;
- AXObject::AXObjectVector controlNameObjects;
- controlObject->name(controlNameFrom, &controlNameObjects);
- if (controlNameFrom == AXNameFromRelatedElement) {
- if (ignoredReasons) {
- HTMLLabelElement* label = labelElementContainer();
- if (label && !label->isSameNode(node())) {
- AXObject* labelAXObject = axObjectCache().getOrCreate(label);
- ignoredReasons->append(IgnoredReason(AXLabelContainer, labelAXObject));
- }
-
- ignoredReasons->append(IgnoredReason(AXLabelFor, controlObject));
+ if (controlObject && controlObject->isCheckboxOrRadio() && controlObject->nameFromLabelElement()) {
+ if (ignoredReasons) {
+ HTMLLabelElement* label = labelElementContainer();
+ if (label && !label->isSameNode(node())) {
+ AXObject* labelAXObject = axObjectCache().getOrCreate(label);
+ ignoredReasons->append(IgnoredReason(AXLabelContainer, labelAXObject));
}
- return true;
+
+ ignoredReasons->append(IgnoredReason(AXLabelFor, controlObject));
}
+ return true;
}
if (m_layoutObject->isBR())
@@ -1501,13 +1496,8 @@ AXObject* AXLayoutObject::accessibilityHitTest(const IntPoint& point) const
// If this element is the label of a control, a hit test should return the control.
if (result->isAXLayoutObject()) {
AXObject* controlObject = toAXLayoutObject(result)->correspondingControlForLabelElement();
- if (controlObject) {
- AXNameFrom controlNameFrom;
- AXObject::AXObjectVector controlNameObjects;
- controlObject->name(controlNameFrom, &controlNameObjects);
- if (controlObject && controlNameFrom == AXNameFromRelatedElement)
- return controlObject;
- }
+ if (controlObject && controlObject->nameFromLabelElement())
+ return controlObject;
}
result = result->parentObjectUnignored();
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698