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

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

Issue 1911473002: Rename transformToRoot:ish names to screenScaleFactorChanged:ish ones (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@svg-hiddencontainer-layout-no-xfrmchg
Patch Set: Update comment in LayoutSVGText. Created 4 years, 8 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/SVGLayoutSupport.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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 for (; start; start = start->parent()) { 252 for (; start; start = start->parent()) {
253 if (start->isSVGRoot()) 253 if (start->isSVGRoot())
254 return toLayoutSVGRoot(start)->isLayoutSizeChanged(); 254 return toLayoutSVGRoot(start)->isLayoutSizeChanged();
255 if (start->isSVGViewportContainer()) 255 if (start->isSVGViewportContainer())
256 return toLayoutSVGViewportContainer(start)->isLayoutSizeChanged(); 256 return toLayoutSVGViewportContainer(start)->isLayoutSizeChanged();
257 } 257 }
258 ASSERT_NOT_REACHED(); 258 ASSERT_NOT_REACHED();
259 return false; 259 return false;
260 } 260 }
261 261
262 bool SVGLayoutSupport::transformToRootChanged(const LayoutObject* ancestor) 262 bool SVGLayoutSupport::screenScaleFactorChanged(const LayoutObject* ancestor)
263 { 263 {
264 while (ancestor && !ancestor->isSVGRoot()) { 264 while (ancestor && !ancestor->isSVGRoot()) {
265 if (ancestor->isSVGTransformableContainer()) 265 if (ancestor->isSVGTransformableContainer())
266 return toLayoutSVGTransformableContainer(ancestor)->didTransformToRo otUpdate(); 266 return toLayoutSVGTransformableContainer(ancestor)->didScreenScaleFa ctorChange();
267 if (ancestor->isSVGViewportContainer()) 267 if (ancestor->isSVGViewportContainer())
268 return toLayoutSVGViewportContainer(ancestor)->didTransformToRootUpd ate(); 268 return toLayoutSVGViewportContainer(ancestor)->didScreenScaleFactorC hange();
269 ancestor = ancestor->parent(); 269 ancestor = ancestor->parent();
270 } 270 }
271 return false; 271 return false;
272 } 272 }
273 273
274 void SVGLayoutSupport::layoutChildren(LayoutObject* firstChild, bool forceLayout , bool transformChanged, bool layoutSizeChanged) 274 void SVGLayoutSupport::layoutChildren(
275 LayoutObject* firstChild, bool forceLayout, bool screenScalingFactorChanged, bool layoutSizeChanged)
275 { 276 {
276 for (LayoutObject* child = firstChild; child; child = child->nextSibling()) { 277 for (LayoutObject* child = firstChild; child; child = child->nextSibling()) {
277 bool forceChildLayout = forceLayout; 278 bool forceChildLayout = forceLayout;
278 279
279 if (transformChanged) { 280 if (screenScalingFactorChanged) {
280 // If the transform changed we need to update the text metrics (note : this also happens for layoutSizeChanged=true). 281 // If the screen scaling factor changed we need to update the text
282 // metrics (note: this also happens for layoutSizeChanged=true).
281 if (child->isSVGText()) 283 if (child->isSVGText())
282 toLayoutSVGText(child)->setNeedsTextMetricsUpdate(); 284 toLayoutSVGText(child)->setNeedsTextMetricsUpdate();
283 forceChildLayout = true; 285 forceChildLayout = true;
284 } 286 }
285 287
286 if (layoutSizeChanged) { 288 if (layoutSizeChanged) {
287 // When selfNeedsLayout is false and the layout size changed, we hav e to check whether this child uses relative lengths 289 // When selfNeedsLayout is false and the layout size changed, we hav e to check whether this child uses relative lengths
288 if (SVGElement* element = child->node()->isSVGElement() ? toSVGEleme nt(child->node()) : 0) { 290 if (SVGElement* element = child->node()->isSVGElement() ? toSVGEleme nt(child->node()) : 0) {
289 if (element->hasRelativeLengths()) { 291 if (element->hasRelativeLengths()) {
290 // FIXME: this should be done on invalidation, not during la yout. 292 // FIXME: this should be done on invalidation, not during la yout.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 575
574 return closestText; 576 return closestText;
575 } 577 }
576 578
577 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObj ect, const FloatPoint& point) 579 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObj ect, const FloatPoint& point)
578 { 580 {
579 return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateL ayoutObject; 581 return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateL ayoutObject;
580 } 582 }
581 583
582 } // namespace blink 584 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698