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

Unified Diff: Source/core/accessibility/AXNodeObject.cpp

Issue 200473005: Use ElementTraversal API in siblingWithAriaRole() to simplify the code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698