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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp

Issue 1661983002: Don't propagate bbox for empty <text> to ancestors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp ('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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // the resources applied to the children (such as clips and filters). This a llows filters applied to containers to correctly bound 189 // the resources applied to the children (such as clips and filters). This a llows filters applied to containers to correctly bound
190 // the children, and also improves inlining of SVG content, as the stroke bo und is used in that situation also. 190 // the children, and also improves inlining of SVG content, as the stroke bo und is used in that situation also.
191 for (LayoutObject* current = container->slowFirstChild(); current; current = current->nextSibling()) { 191 for (LayoutObject* current = container->slowFirstChild(); current; current = current->nextSibling()) {
192 if (current->isSVGHiddenContainer()) 192 if (current->isSVGHiddenContainer())
193 continue; 193 continue;
194 194
195 // Don't include elements in the union that do not layout. 195 // Don't include elements in the union that do not layout.
196 if (current->isSVGShape() && toLayoutSVGShape(current)->isShapeEmpty()) 196 if (current->isSVGShape() && toLayoutSVGShape(current)->isShapeEmpty())
197 continue; 197 continue;
198 198
199 if (current->isSVGText() && !toLayoutSVGText(current)->isObjectBoundingB oxValid())
200 continue;
201
199 const AffineTransform& transform = current->localToParentTransform(); 202 const AffineTransform& transform = current->localToParentTransform();
200 updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, curre nt, 203 updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, curre nt,
201 transform.mapRect(current->objectBoundingBox())); 204 transform.mapRect(current->objectBoundingBox()));
202 strokeBoundingBox.unite(transform.mapRect(current->paintInvalidationRect InLocalCoordinates())); 205 strokeBoundingBox.unite(transform.mapRect(current->paintInvalidationRect InLocalCoordinates()));
203 } 206 }
204 207
205 paintInvalidationBoundingBox = strokeBoundingBox; 208 paintInvalidationBoundingBox = strokeBoundingBox;
206 } 209 }
207 210
208 const LayoutSVGRoot* SVGLayoutSupport::findTreeRootObject(const LayoutObject* st art) 211 const LayoutSVGRoot* SVGLayoutSupport::findTreeRootObject(const LayoutObject* st art)
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 481
479 // FIXME: trying to compute a device space transform at record time is wrong . All clients 482 // FIXME: trying to compute a device space transform at record time is wrong . All clients
480 // should be updated to avoid relying on this information, and the method sh ould be removed. 483 // should be updated to avoid relying on this information, and the method sh ould be removed.
481 AffineTransform ctm = deprecatedCalculateTransformToLayer(layoutObject) * Su btreeContentTransformScope::currentContentTransformation(); 484 AffineTransform ctm = deprecatedCalculateTransformToLayer(layoutObject) * Su btreeContentTransformScope::currentContentTransformation();
482 ctm.scale(layoutObject->document().frameHost()->deviceScaleFactor()); 485 ctm.scale(layoutObject->document().frameHost()->deviceScaleFactor());
483 486
484 return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(), 2)) / 2)); 487 return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(), 2)) / 2));
485 } 488 }
486 489
487 } // namespace blink 490 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698