| 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 a825d14a72649fbd5817255b43d4f12ab82c2a65..85a322995824bfb8db42afe1f1ca97390faeca3c 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| @@ -51,6 +51,7 @@
|
| #include "core/html/HTMLOptionElement.h"
|
| #include "core/html/HTMLSelectElement.h"
|
| #include "core/html/HTMLTextAreaElement.h"
|
| +#include "core/html/LabelsNodeList.h"
|
| #include "core/html/shadow/ShadowElementNames.h"
|
| #include "core/layout/HitTestResult.h"
|
| #include "core/layout/LayoutFieldset.h"
|
| @@ -2465,12 +2466,17 @@ LayoutRect AXLayoutObject::computeElementRect() const
|
| if (isWebArea() && obj->frame()->view())
|
| result.setSize(LayoutSize(obj->frame()->view()->contentsSize()));
|
|
|
| - // Checkboxes and radio buttons include their label as part of their rect.
|
| - if (isCheckboxOrRadio()) {
|
| - HTMLLabelElement* label = labelForElement(toElement(m_layoutObject->node()));
|
| - if (label && label->layoutObject()) {
|
| - LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRect();
|
| - result.unite(labelRect);
|
| + // Checkboxes and radio buttons include their labels as part of their rect.
|
| + if (isCheckboxOrRadio() && isLabelableElement(obj->node())) {
|
| + LabelsNodeList* labels = toLabelableElement(obj->node())->labels();
|
| + if (labels) {
|
| + for (unsigned labelIndex = 0; labelIndex < labels->length(); ++labelIndex) {
|
| + AXObject* labelAXObject = axObjectCache().getOrCreate(labels->item(labelIndex));
|
| + if (labelAXObject) {
|
| + LayoutRect labelRect = labelAXObject->elementRect();
|
| + result.unite(labelRect);
|
| + }
|
| + }
|
| }
|
| }
|
|
|
|
|