| 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();
|
|
|