Index: Source/core/accessibility/AXNodeObject.cpp |
diff --git a/Source/core/accessibility/AXNodeObject.cpp b/Source/core/accessibility/AXNodeObject.cpp |
index 73b63c36c183266f8c3daf3ea426bd825b702cc0..fa59758de580dea50ab555dffcddfbc70333931b 100644 |
--- a/Source/core/accessibility/AXNodeObject.cpp |
+++ b/Source/core/accessibility/AXNodeObject.cpp |
@@ -371,12 +371,10 @@ static Element* siblingWithAriaRole(String role, Node* node) |
if (!parent) |
return 0; |
- for (Node* sibling = parent->firstChild(); sibling; sibling = sibling->nextSibling()) { |
- if (sibling->isElementNode()) { |
- const AtomicString& siblingAriaRole = toElement(sibling)->getAttribute(roleAttr); |
- if (equalIgnoringCase(siblingAriaRole, role)) |
- return toElement(sibling); |
- } |
+ for (Element* sibling = ElementTraversal::firstChild(*parent); sibling; sibling = ElementTraversal::nextSibling(*sibling)) { |
+ const AtomicString& siblingAriaRole = sibling->getAttribute(roleAttr); |
+ if (equalIgnoringCase(siblingAriaRole, role)) |
+ return sibling; |
} |
return 0; |