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

Unified Diff: Source/core/rendering/TextAutosizer.cpp

Issue 482903002: Get rid of loops looking for the first Element ancestor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 6 years, 4 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/core/editing/htmlediting.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/core/editing/htmlediting.cpp ('k') | Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698