Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
| 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
| 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
| 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
| 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
| 9 * Copyright (C) 2012 Google Inc. | 9 * Copyright (C) 2012 Google Inc. |
| 10 * | 10 * |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool LayoutSVGText::isChildAllowed(LayoutObject* child, const ComputedStyle&) co nst | 71 bool LayoutSVGText::isChildAllowed(LayoutObject* child, const ComputedStyle&) co nst |
| 72 { | 72 { |
| 73 return child->isSVGInline() || (child->isText() && SVGLayoutSupport::isLayou tableTextNode(child)); | 73 return child->isSVGInline() || (child->isText() && SVGLayoutSupport::isLayou tableTextNode(child)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 LayoutSVGText* LayoutSVGText::locateLayoutSVGTextAncestor(LayoutObject* start) | 76 LayoutSVGText* LayoutSVGText::locateLayoutSVGTextAncestor(LayoutObject* start) |
| 77 { | 77 { |
| 78 ASSERT(start); | 78 ASSERT(start); |
| 79 while (start && !start->isSVGText()) | 79 for (; start; start = start->parent()) { |
| 80 start = start->parent(); | 80 if (start->isSVGText()) |
| 81 if (!start || !start->isSVGText()) | 81 return toLayoutSVGText(start); |
| 82 return nullptr; | 82 } |
| 83 return toLayoutSVGText(start); | 83 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.
| |
| 84 } | 84 } |
| 85 | 85 |
| 86 const LayoutSVGText* LayoutSVGText::locateLayoutSVGTextAncestor(const LayoutObje ct* start) | 86 const LayoutSVGText* LayoutSVGText::locateLayoutSVGTextAncestor(const LayoutObje ct* start) |
| 87 { | 87 { |
| 88 ASSERT(start); | 88 ASSERT(start); |
| 89 while (start && !start->isSVGText()) | 89 for (; start; start = start->parent()) { |
| 90 start = start->parent(); | 90 if (start->isSVGText()) |
| 91 if (!start || !start->isSVGText()) | 91 return toLayoutSVGText(start); |
| 92 return nullptr; | 92 } |
| 93 return toLayoutSVGText(start); | 93 return nullptr; |
| 94 } | 94 } |
| 95 | 95 |
| 96 static inline void collectLayoutAttributes(LayoutObject* text, Vector<SVGTextLay outAttributes*>& attributes) | 96 static inline void collectLayoutAttributes(LayoutObject* text, Vector<SVGTextLay outAttributes*>& attributes) |
| 97 { | 97 { |
| 98 for (LayoutObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) { | 98 for (LayoutObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) { |
| 99 if (descendant->isSVGInlineText()) | 99 if (descendant->isSVGInlineText()) |
| 100 attributes.append(toLayoutSVGInlineText(descendant)->layoutAttribute s()); | 100 attributes.append(toLayoutSVGInlineText(descendant)->layoutAttribute s()); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 SVGResourcesCache::clientWillBeRemovedFromTree(child); | 506 SVGResourcesCache::clientWillBeRemovedFromTree(child); |
| 507 | 507 |
| 508 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; | 508 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; |
| 509 FontCachePurgePreventer fontCachePurgePreventer; | 509 FontCachePurgePreventer fontCachePurgePreventer; |
| 510 subtreeChildWillBeRemoved(child, affectedAttributes); | 510 subtreeChildWillBeRemoved(child, affectedAttributes); |
| 511 LayoutSVGBlock::removeChild(child); | 511 LayoutSVGBlock::removeChild(child); |
| 512 subtreeChildWasRemoved(affectedAttributes); | 512 subtreeChildWasRemoved(affectedAttributes); |
| 513 } | 513 } |
| 514 | 514 |
| 515 } | 515 } |
| OLD | NEW |