| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 , SVGTests(this) | 37 , SVGTests(this) |
| 38 , m_transform(SVGAnimatedTransformList::create(this, SVGNames::transformAttr
, SVGTransformList::create())) | 38 , m_transform(SVGAnimatedTransformList::create(this, SVGNames::transformAttr
, SVGTransformList::create())) |
| 39 { | 39 { |
| 40 addToPropertyMap(m_transform); | 40 addToPropertyMap(m_transform); |
| 41 } | 41 } |
| 42 | 42 |
| 43 SVGGraphicsElement::~SVGGraphicsElement() | 43 SVGGraphicsElement::~SVGGraphicsElement() |
| 44 { | 44 { |
| 45 } | 45 } |
| 46 | 46 |
| 47 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getTransformToElement(SVGElemen
t* target, ExceptionState& exceptionState) | 47 void SVGGraphicsElement::trace(Visitor* visitor) |
| 48 { |
| 49 visitor->trace(m_transform); |
| 50 SVGElement::trace(visitor); |
| 51 SVGTests::trace(visitor); |
| 52 } |
| 53 |
| 54 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> SVGGraphicsElement::getTransformToEleme
nt(SVGElement* target, ExceptionState& exceptionState) |
| 48 { | 55 { |
| 49 AffineTransform ctm = getCTM(AllowStyleUpdate); | 56 AffineTransform ctm = getCTM(AllowStyleUpdate); |
| 50 | 57 |
| 51 if (target && target->isSVGGraphicsElement()) { | 58 if (target && target->isSVGGraphicsElement()) { |
| 52 AffineTransform targetCTM = toSVGGraphicsElement(target)->getCTM(AllowSt
yleUpdate); | 59 AffineTransform targetCTM = toSVGGraphicsElement(target)->getCTM(AllowSt
yleUpdate); |
| 53 if (!targetCTM.isInvertible()) { | 60 if (!targetCTM.isInvertible()) { |
| 54 exceptionState.throwDOMException(InvalidStateError, "The target tran
sformation is not invertable."); | 61 exceptionState.throwDOMException(InvalidStateError, "The target tran
sformation is not invertable."); |
| 55 return nullptr; | 62 return nullptr; |
| 56 } | 63 } |
| 57 ctm = targetCTM.inverse() * ctm; | 64 ctm = targetCTM.inverse() * ctm; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 AffineTransform SVGGraphicsElement::getCTM(StyleUpdateStrategy styleUpdateStrate
gy) | 112 AffineTransform SVGGraphicsElement::getCTM(StyleUpdateStrategy styleUpdateStrate
gy) |
| 106 { | 113 { |
| 107 return computeCTM(NearestViewportScope, styleUpdateStrategy); | 114 return computeCTM(NearestViewportScope, styleUpdateStrategy); |
| 108 } | 115 } |
| 109 | 116 |
| 110 AffineTransform SVGGraphicsElement::getScreenCTM(StyleUpdateStrategy styleUpdate
Strategy) | 117 AffineTransform SVGGraphicsElement::getScreenCTM(StyleUpdateStrategy styleUpdate
Strategy) |
| 111 { | 118 { |
| 112 return computeCTM(ScreenScope, styleUpdateStrategy); | 119 return computeCTM(ScreenScope, styleUpdateStrategy); |
| 113 } | 120 } |
| 114 | 121 |
| 115 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getCTMFromJavascript() | 122 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> SVGGraphicsElement::getCTMFromJavascrip
t() |
| 116 { | 123 { |
| 117 return SVGMatrixTearOff::create(getCTM()); | 124 return SVGMatrixTearOff::create(getCTM()); |
| 118 } | 125 } |
| 119 | 126 |
| 120 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getScreenCTMFromJavascript() | 127 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> SVGGraphicsElement::getScreenCTMFromJav
ascript() |
| 121 { | 128 { |
| 122 return SVGMatrixTearOff::create(getScreenCTM()); | 129 return SVGMatrixTearOff::create(getScreenCTM()); |
| 123 } | 130 } |
| 124 | 131 |
| 125 AffineTransform SVGGraphicsElement::animatedLocalTransform() const | 132 AffineTransform SVGGraphicsElement::animatedLocalTransform() const |
| 126 { | 133 { |
| 127 AffineTransform matrix; | 134 AffineTransform matrix; |
| 128 RenderStyle* style = renderer() ? renderer()->style() : 0; | 135 RenderStyle* style = renderer() ? renderer()->style() : 0; |
| 129 | 136 |
| 130 // If CSS property was set, use that, otherwise fallback to attribute (if se
t). | 137 // If CSS property was set, use that, otherwise fallback to attribute (if se
t). |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 { | 240 { |
| 234 document().updateLayoutIgnorePendingStylesheets(); | 241 document().updateLayoutIgnorePendingStylesheets(); |
| 235 | 242 |
| 236 // FIXME: Eventually we should support getBBox for detached elements. | 243 // FIXME: Eventually we should support getBBox for detached elements. |
| 237 if (!renderer()) | 244 if (!renderer()) |
| 238 return FloatRect(); | 245 return FloatRect(); |
| 239 | 246 |
| 240 return renderer()->objectBoundingBox(); | 247 return renderer()->objectBoundingBox(); |
| 241 } | 248 } |
| 242 | 249 |
| 243 PassRefPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript() | 250 PassRefPtrWillBeRawPtr<SVGRectTearOff> SVGGraphicsElement::getBBoxFromJavascript
() |
| 244 { | 251 { |
| 245 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn
imVal); | 252 return SVGRectTearOff::create(SVGRect::create(getBBox()), 0, PropertyIsNotAn
imVal); |
| 246 } | 253 } |
| 247 | 254 |
| 248 RenderObject* SVGGraphicsElement::createRenderer(RenderStyle*) | 255 RenderObject* SVGGraphicsElement::createRenderer(RenderStyle*) |
| 249 { | 256 { |
| 250 // By default, any subclass is expected to do path-based drawing | 257 // By default, any subclass is expected to do path-based drawing |
| 251 return new RenderSVGPath(this); | 258 return new RenderSVGPath(this); |
| 252 } | 259 } |
| 253 | 260 |
| 254 void SVGGraphicsElement::toClipPath(Path& path) | 261 void SVGGraphicsElement::toClipPath(Path& path) |
| 255 { | 262 { |
| 256 updatePathFromGraphicsElement(this, path); | 263 updatePathFromGraphicsElement(this, path); |
| 257 // FIXME: How do we know the element has done a layout? | 264 // FIXME: How do we know the element has done a layout? |
| 258 path.transform(animatedLocalTransform()); | 265 path.transform(animatedLocalTransform()); |
| 259 } | 266 } |
| 260 | 267 |
| 261 } | 268 } |
| OLD | NEW |