Chromium Code Reviews| Index: Source/core/accessibility/AXNodeObject.cpp |
| diff --git a/Source/core/accessibility/AXNodeObject.cpp b/Source/core/accessibility/AXNodeObject.cpp |
| index fa59758de580dea50ab555dffcddfbc70333931b..f78551a2d332baf5d98eff0e1c3d4fbb433a96ac 100644 |
| --- a/Source/core/accessibility/AXNodeObject.cpp |
| +++ b/Source/core/accessibility/AXNodeObject.cpp |
| @@ -1480,13 +1480,8 @@ HTMLLabelElement* AXNodeObject::labelElementContainer() const |
| if (isControl()) |
| return 0; |
| - // find if this has a parent that is a label |
| - for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentNode()) { |
| - if (isHTMLLabelElement(*parentNode)) |
| - return toHTMLLabelElement(parentNode); |
| - } |
| - |
| - return 0; |
| + // find if this has a ancestor that is a label |
| + return isHTMLLabelElement(*node()) ? toHTMLLabelElement(node()) : Traversal<HTMLLabelElement>::firstAncestor(*node()); |
|
esprehn
2014/03/21 07:58:33
Can we use if statements here? I don't think all t
Inactive
2014/03/21 14:37:24
Done.
|
| } |
| void AXNodeObject::setFocused(bool on) |