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

Side by Side Diff: Source/core/svg/SVGLocatable.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGMPathElement.cpp » ('j') | 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) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Google, Inc. All rights reserved. 4 * Copyright (C) 2009 Google, Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (isViewportElement(current)) 58 if (isViewportElement(current))
59 farthest = toSVGElement(current); 59 farthest = toSVGElement(current);
60 } 60 }
61 return farthest; 61 return farthest;
62 } 62 }
63 63
64 SVGRect SVGLocatable::getBBox(SVGElement* element, StyleUpdateStrategy styleUpda teStrategy) 64 SVGRect SVGLocatable::getBBox(SVGElement* element, StyleUpdateStrategy styleUpda teStrategy)
65 { 65 {
66 ASSERT(element); 66 ASSERT(element);
67 if (styleUpdateStrategy == AllowStyleUpdate) 67 if (styleUpdateStrategy == AllowStyleUpdate)
68 element->document()->updateLayoutIgnorePendingStylesheets(); 68 element->document().updateLayoutIgnorePendingStylesheets();
69 69
70 // FIXME: Eventually we should support getBBox for detached elements. 70 // FIXME: Eventually we should support getBBox for detached elements.
71 if (!element->renderer()) 71 if (!element->renderer())
72 return SVGRect(); 72 return SVGRect();
73 73
74 return element->renderer()->objectBoundingBox(); 74 return element->renderer()->objectBoundingBox();
75 } 75 }
76 76
77 AffineTransform SVGLocatable::computeCTM(SVGElement* element, CTMScope mode, Sty leUpdateStrategy styleUpdateStrategy) 77 AffineTransform SVGLocatable::computeCTM(SVGElement* element, CTMScope mode, Sty leUpdateStrategy styleUpdateStrategy)
78 { 78 {
79 ASSERT(element); 79 ASSERT(element);
80 if (styleUpdateStrategy == AllowStyleUpdate) 80 if (styleUpdateStrategy == AllowStyleUpdate)
81 element->document()->updateLayoutIgnorePendingStylesheets(); 81 element->document().updateLayoutIgnorePendingStylesheets();
82 82
83 AffineTransform ctm; 83 AffineTransform ctm;
84 84
85 SVGElement* stopAtElement = mode == NearestViewportScope ? nearestViewportEl ement(element) : 0; 85 SVGElement* stopAtElement = mode == NearestViewportScope ? nearestViewportEl ement(element) : 0;
86 for (Element* currentElement = element; currentElement; currentElement = cur rentElement->parentOrShadowHostElement()) { 86 for (Element* currentElement = element; currentElement; currentElement = cur rentElement->parentOrShadowHostElement()) {
87 if (!currentElement->isSVGElement()) 87 if (!currentElement->isSVGElement())
88 break; 88 break;
89 89
90 ctm = toSVGElement(currentElement)->localCoordinateSpaceTransform(mode). multiply(ctm); 90 ctm = toSVGElement(currentElement)->localCoordinateSpaceTransform(mode). multiply(ctm);
91 91
(...skipping 15 matching lines...) Expand all
107 es.throwDOMException(InvalidStateError); 107 es.throwDOMException(InvalidStateError);
108 return ctm; 108 return ctm;
109 } 109 }
110 ctm = targetCTM.inverse() * ctm; 110 ctm = targetCTM.inverse() * ctm;
111 } 111 }
112 112
113 return ctm; 113 return ctm;
114 } 114 }
115 115
116 } 116 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGMPathElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698