| 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, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> |
| 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 23 matching lines...) Expand all Loading... |
| 34 { | 34 { |
| 35 setDefault(); | 35 setDefault(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void SVGPreserveAspectRatio::setDefault() | 38 void SVGPreserveAspectRatio::setDefault() |
| 39 { | 39 { |
| 40 m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID; | 40 m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID; |
| 41 m_meetOrSlice = SVG_MEETORSLICE_MEET; | 41 m_meetOrSlice = SVG_MEETORSLICE_MEET; |
| 42 } | 42 } |
| 43 | 43 |
| 44 PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio> SVGPreserveAspectRatio::clone() c
onst | 44 RawPtr<SVGPreserveAspectRatio> SVGPreserveAspectRatio::clone() const |
| 45 { | 45 { |
| 46 RefPtrWillBeRawPtr<SVGPreserveAspectRatio> preserveAspectRatio = create(); | 46 RawPtr<SVGPreserveAspectRatio> preserveAspectRatio = create(); |
| 47 | 47 |
| 48 preserveAspectRatio->m_align = m_align; | 48 preserveAspectRatio->m_align = m_align; |
| 49 preserveAspectRatio->m_meetOrSlice = m_meetOrSlice; | 49 preserveAspectRatio->m_meetOrSlice = m_meetOrSlice; |
| 50 | 50 |
| 51 return preserveAspectRatio.release(); | 51 return preserveAspectRatio.release(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 template<typename CharType> | 54 template<typename CharType> |
| 55 SVGParsingError SVGPreserveAspectRatio::parseInternal(const CharType*& ptr, cons
t CharType* end, bool validate) | 55 SVGParsingError SVGPreserveAspectRatio::parseInternal(const CharType*& ptr, cons
t CharType* end, bool validate) |
| 56 { | 56 { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 meetOrSliceString = " meet"; | 372 meetOrSliceString = " meet"; |
| 373 break; | 373 break; |
| 374 case SVG_MEETORSLICE_SLICE: | 374 case SVG_MEETORSLICE_SLICE: |
| 375 meetOrSliceString = " slice"; | 375 meetOrSliceString = " slice"; |
| 376 break; | 376 break; |
| 377 } | 377 } |
| 378 builder.append(meetOrSliceString); | 378 builder.append(meetOrSliceString); |
| 379 return builder.toString(); | 379 return builder.toString(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void SVGPreserveAspectRatio::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other,
SVGElement*) | 382 void SVGPreserveAspectRatio::add(RawPtr<SVGPropertyBase> other, SVGElement*) |
| 383 { | 383 { |
| 384 ASSERT_NOT_REACHED(); | 384 ASSERT_NOT_REACHED(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void SVGPreserveAspectRatio::calculateAnimatedValue(SVGAnimationElement* animati
onElement, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPro
pertyBase> fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPt
rWillBeRawPtr<SVGPropertyBase>, SVGElement*) | 387 void SVGPreserveAspectRatio::calculateAnimatedValue(SVGAnimationElement* animati
onElement, float percentage, unsigned repeatCount, RawPtr<SVGPropertyBase> fromV
alue, RawPtr<SVGPropertyBase> toValue, RawPtr<SVGPropertyBase>, SVGElement*) |
| 388 { | 388 { |
| 389 ASSERT(animationElement); | 389 ASSERT(animationElement); |
| 390 | 390 |
| 391 bool useToValue; | 391 bool useToValue; |
| 392 animationElement->animateDiscreteType(percentage, false, true, useToValue); | 392 animationElement->animateDiscreteType(percentage, false, true, useToValue); |
| 393 | 393 |
| 394 RefPtrWillBeRawPtr<SVGPreserveAspectRatio> preserveAspectRatioToUse = useToV
alue ? toSVGPreserveAspectRatio(toValue) : toSVGPreserveAspectRatio(fromValue); | 394 RawPtr<SVGPreserveAspectRatio> preserveAspectRatioToUse = useToValue ? toSVG
PreserveAspectRatio(toValue) : toSVGPreserveAspectRatio(fromValue); |
| 395 | 395 |
| 396 m_align = preserveAspectRatioToUse->m_align; | 396 m_align = preserveAspectRatioToUse->m_align; |
| 397 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice; | 397 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice; |
| 398 } | 398 } |
| 399 | 399 |
| 400 float SVGPreserveAspectRatio::calculateDistance(PassRefPtrWillBeRawPtr<SVGProper
tyBase> toValue, SVGElement* contextElement) | 400 float SVGPreserveAspectRatio::calculateDistance(RawPtr<SVGPropertyBase> toValue,
SVGElement* contextElement) |
| 401 { | 401 { |
| 402 // No paced animations for SVGPreserveAspectRatio. | 402 // No paced animations for SVGPreserveAspectRatio. |
| 403 return -1; | 403 return -1; |
| 404 } | 404 } |
| 405 | 405 |
| 406 } // namespace blink | 406 } // namespace blink |
| OLD | NEW |