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

Side by Side Diff: Source/core/rendering/svg/SVGRenderSupport.cpp

Issue 355813004: [SVG2] Elements that don't render shouldn't contribute to ancestor bboxes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix nit Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 objectBoundingBoxValid = false; 130 objectBoundingBoxValid = false;
131 strokeBoundingBox = FloatRect(); 131 strokeBoundingBox = FloatRect();
132 132
133 // When computing the strokeBoundingBox, we use the repaintRects of the cont ainer's children so that the container's stroke includes 133 // When computing the strokeBoundingBox, we use the repaintRects of the cont ainer's children so that the container's stroke includes
134 // the resources applied to the children (such as clips and filters). This a llows filters applied to containers to correctly bound 134 // the resources applied to the children (such as clips and filters). This a llows filters applied to containers to correctly bound
135 // the children, and also improves inlining of SVG content, as the stroke bo und is used in that situation also. 135 // the children, and also improves inlining of SVG content, as the stroke bo und is used in that situation also.
136 for (RenderObject* current = container->slowFirstChild(); current; current = current->nextSibling()) { 136 for (RenderObject* current = container->slowFirstChild(); current; current = current->nextSibling()) {
137 if (current->isSVGHiddenContainer()) 137 if (current->isSVGHiddenContainer())
138 continue; 138 continue;
139 139
140 // Don't include elements in the union that do not render.
141 if (current->isSVGShape() && toRenderSVGShape(current)->isShapeEmpty())
f(malita) 2014/06/25 15:16:50 We have a similar check for containers in updateOb
142 continue;
143
140 const AffineTransform& transform = current->localToParentTransform(); 144 const AffineTransform& transform = current->localToParentTransform();
141 updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, curre nt, 145 updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, curre nt,
142 transform.mapRect(current->objectBoundingBox())); 146 transform.mapRect(current->objectBoundingBox()));
143 strokeBoundingBox.unite(transform.mapRect(current->paintInvalidationRect InLocalCoordinates())); 147 strokeBoundingBox.unite(transform.mapRect(current->paintInvalidationRect InLocalCoordinates()));
144 } 148 }
145 149
146 repaintBoundingBox = strokeBoundingBox; 150 repaintBoundingBox = strokeBoundingBox;
147 } 151 }
148 152
149 bool SVGRenderSupport::paintInfoIntersectsRepaintRect(const FloatRect& localRepa intRect, const AffineTransform& localTransform, const PaintInfo& paintInfo) 153 bool SVGRenderSupport::paintInfoIntersectsRepaintRect(const FloatRect& localRepa intRect, const AffineTransform& localTransform, const PaintInfo& paintInfo)
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 387 }
384 388
385 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) 389 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
386 { 390 {
387 ASSERT(object->isText()); 391 ASSERT(object->isText());
388 // <br> is marked as text, but is not handled by the SVG rendering code-path . 392 // <br> is marked as text, but is not handled by the SVG rendering code-path .
389 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text(); 393 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text();
390 } 394 }
391 395
392 } 396 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698