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

Unified Diff: Source/core/layout/svg/LayoutSVGText.cpp

Issue 1308983006: Don't drop type information returned from locateRenderSVGTextAncestor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 5 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/layout/svg/LayoutSVGText.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGText.cpp
diff --git a/Source/core/layout/svg/LayoutSVGText.cpp b/Source/core/layout/svg/LayoutSVGText.cpp
index 1f76ce3a176786a71b937669163b679e8bd72946..add525dcd4b4b438dd5183487472b687920d1dc2 100644
--- a/Source/core/layout/svg/LayoutSVGText.cpp
+++ b/Source/core/layout/svg/LayoutSVGText.cpp
@@ -76,21 +76,21 @@ bool LayoutSVGText::isChildAllowed(LayoutObject* child, const ComputedStyle&) co
LayoutSVGText* LayoutSVGText::locateLayoutSVGTextAncestor(LayoutObject* start)
{
ASSERT(start);
- while (start && !start->isSVGText())
- start = start->parent();
- if (!start || !start->isSVGText())
- return nullptr;
- return toLayoutSVGText(start);
+ for (; start; start = start->parent()) {
+ if (start->isSVGText())
+ return toLayoutSVGText(start);
+ }
+ return nullptr;
f(malita) 2015/08/26 19:00:57 Nit: instead of duplicating the impl below, I'd vo
fs 2015/08/27 10:25:09 Done.
}
const LayoutSVGText* LayoutSVGText::locateLayoutSVGTextAncestor(const LayoutObject* start)
{
ASSERT(start);
- while (start && !start->isSVGText())
- start = start->parent();
- if (!start || !start->isSVGText())
- return nullptr;
- return toLayoutSVGText(start);
+ for (; start; start = start->parent()) {
+ if (start->isSVGText())
+ return toLayoutSVGText(start);
+ }
+ return nullptr;
}
static inline void collectLayoutAttributes(LayoutObject* text, Vector<SVGTextLayoutAttributes*>& attributes)
« no previous file with comments | « Source/core/layout/svg/LayoutSVGText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698