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

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

Issue 1007353002: Use NodeTraversal to iterate over the accessibility nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index a1f56766d0d975ee78bac70cf5d0f66a1d0dbfa4..75cd4a77849ba1a7e80ddbcd4286a37584464f44 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -1533,9 +1533,9 @@ LayoutRect AXNodeObject::elementRect() const
if (node()->parentElement()->isInCanvasSubtree()) {
LayoutRect rect;
- for (Node* child = node()->firstChild(); child; child = child->nextSibling()) {
- if (child->isHTMLElement()) {
- if (AXObject* obj = axObjectCache()->get(child)) {
+ for (Node& child : NodeTraversal::childrenOf(*node())) {
+ if (child.isHTMLElement()) {
+ if (AXObject* obj = axObjectCache()->get(&child)) {
if (rect.isEmpty())
rect = obj->elementRect();
else
@@ -1630,8 +1630,8 @@ void AXNodeObject::addChildren()
if (layoutObject() && !isHTMLCanvasElement(*m_node))
return;
- for (Node* child = m_node->firstChild(); child; child = child->nextSibling())
- addChild(axObjectCache()->getOrCreate(child));
+ for (Node& child : NodeTraversal::childrenOf(*m_node))
+ addChild(axObjectCache()->getOrCreate(&child));
for (unsigned i = 0; i < m_children.size(); ++i)
m_children[i].get()->setParent(this);
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698