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

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

Issue 1406303007: Drop SVGGraphicsElement.getTransformToElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 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) 2014 Google, Inc. 4 * Copyright (C) 2014 Google, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 { 43 {
44 } 44 }
45 45
46 DEFINE_TRACE(SVGGraphicsElement) 46 DEFINE_TRACE(SVGGraphicsElement)
47 { 47 {
48 visitor->trace(m_transform); 48 visitor->trace(m_transform);
49 SVGElement::trace(visitor); 49 SVGElement::trace(visitor);
50 SVGTests::trace(visitor); 50 SVGTests::trace(visitor);
51 } 51 }
52 52
53 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> SVGGraphicsElement::getTransformToEleme nt(SVGElement* target, ExceptionState& exceptionState)
54 {
55 AffineTransform ctm = getCTM(AllowStyleUpdate);
56
57 if (target && target->isSVGGraphicsElement()) {
58 AffineTransform targetCTM = toSVGGraphicsElement(target)->getCTM(AllowSt yleUpdate);
59 if (!targetCTM.isInvertible()) {
60 exceptionState.throwDOMException(InvalidStateError, "The target tran sformation is not invertable.");
61 return nullptr;
62 }
63 ctm = targetCTM.inverse() * ctm;
64 }
65
66 return SVGMatrixTearOff::create(ctm);
67 }
68
69 static bool isViewportElement(const Element& element) 53 static bool isViewportElement(const Element& element)
70 { 54 {
71 return (isSVGSVGElement(element) 55 return (isSVGSVGElement(element)
72 || isSVGSymbolElement(element) 56 || isSVGSymbolElement(element)
73 || isSVGForeignObjectElement(element) 57 || isSVGForeignObjectElement(element)
74 || isSVGImageElement(element)); 58 || isSVGImageElement(element));
75 } 59 }
76 60
77 AffineTransform SVGGraphicsElement::computeCTM(SVGElement::CTMScope mode, 61 AffineTransform SVGGraphicsElement::computeCTM(SVGElement::CTMScope mode,
78 SVGGraphicsElement::StyleUpdateStrategy styleUpdateStrategy, const SVGGraphi csElement* ancestor) const 62 SVGGraphicsElement::StyleUpdateStrategy styleUpdateStrategy, const SVGGraphi csElement* ancestor) const
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 223
240 return layoutObject()->objectBoundingBox(); 224 return layoutObject()->objectBoundingBox();
241 } 225 }
242 226
243 PassRefPtrWillBeRawPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript () 227 PassRefPtrWillBeRawPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript ()
244 { 228 {
245 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn imVal); 229 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn imVal);
246 } 230 }
247 231
248 } 232 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGGraphicsElement.h ('k') | third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698