Chromium Code Reviews| 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) |