Index: Source/core/rendering/TextAutosizer.cpp |
diff --git a/Source/core/rendering/TextAutosizer.cpp b/Source/core/rendering/TextAutosizer.cpp |
index 5b3581404bab4d5323dfa210328611c6d40afa7e..6d4807248c2e1b58070cd7b131cf1244daec8113 100644 |
--- a/Source/core/rendering/TextAutosizer.cpp |
+++ b/Source/core/rendering/TextAutosizer.cpp |
@@ -121,10 +121,9 @@ static const RenderObject* parentElementRenderer(const RenderObject* renderer) |
if (!node) |
return 0; |
- for (node = node->parentNode(); node; node = node->parentNode()) { |
- if (node->isElementNode()) |
- return node->renderer(); |
- } |
+ // FIXME: This should be using NodeRenderingTraversal::parent(). |
+ if (Element* parent = node->parentElement()) |
+ return parent->renderer(); |
return 0; |
} |