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) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2012. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2012. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 ASSERT(length() == 1); | 344 ASSERT(length() == 1); |
345 if (at(0)->transformType() == toList->at(0)->transformType()) | 345 if (at(0)->transformType() == toList->at(0)->transformType()) |
346 return -1; | 346 return -1; |
347 | 347 |
348 // Spec: http://www.w3.org/TR/SVG/animate.html#complexDistances | 348 // Spec: http://www.w3.org/TR/SVG/animate.html#complexDistances |
349 // Paced animations assume a notion of distance between the various animatio
n values defined by the 'to', 'from', 'by' and 'values' attributes. | 349 // Paced animations assume a notion of distance between the various animatio
n values defined by the 'to', 'from', 'by' and 'values' attributes. |
350 // Distance is defined only for scalar types (such as <length>), colors and
the subset of transformation types that are supported by 'animateTransform'. | 350 // Distance is defined only for scalar types (such as <length>), colors and
the subset of transformation types that are supported by 'animateTransform'. |
351 return SVGTransformDistance(at(0), toList->at(0)).distance(); | 351 return SVGTransformDistance(at(0), toList->at(0)).distance(); |
352 } | 352 } |
353 | 353 |
| 354 PassRefPtrWillBeRawPtr<SVGTransform>SVGTransformList::initialize(PassRefPtrWillB
eRawPtr<SVGTransform> passNewItem) |
| 355 { |
| 356 RefPtrWillBeRawPtr<SVGTransform> newItem = passNewItem; |
| 357 |
| 358 // SVG2-Draft Spec: If newItem is already in a list, then a new SVGTransform
object is created with the same values as newItem and this item is inserted int
o the list. |
| 359 // Otherwise, newItem itself is inserted into the list. |
| 360 if (newItem->ownerList()) |
| 361 return Base::initialize(newItem->clone()); |
| 362 |
| 363 return Base::initialize(newItem); |
354 } | 364 } |
| 365 |
| 366 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformList::appendItem(PassRefPtrWill
BeRawPtr<SVGTransform> passNewItem) |
| 367 { |
| 368 RefPtrWillBeRawPtr<SVGTransform> newItem = passNewItem; |
| 369 |
| 370 // SVG2-Draft Spec: If newItem is already in a list, then a new SVGTransform
object is created with the same values as newItem and this item is inserted int
o the list. |
| 371 // Otherwise, newItem itself is inserted into the list. |
| 372 if (newItem->ownerList()) |
| 373 return Base::appendItem(newItem->clone()); |
| 374 |
| 375 return Base::appendItem(newItem); |
| 376 } |
| 377 |
| 378 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformList::insertItemBefore(PassRefP
trWillBeRawPtr<SVGTransform> passNewItem, size_t index) |
| 379 { |
| 380 RefPtrWillBeRawPtr<SVGTransform> newItem = passNewItem; |
| 381 |
| 382 // SVG2-Draft Spec: If newItem is already in a list, then a new SVGTransform
object is created with the same values as newItem and this item is inserted int
o the list. |
| 383 // Otherwise, newItem itself is inserted into the list. |
| 384 if (newItem->ownerList()) |
| 385 return Base::insertItemBefore(newItem->clone(), index); |
| 386 |
| 387 return Base::insertItemBefore(newItem, index); |
| 388 } |
| 389 |
| 390 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformList::replaceItem(PassRefPtrWil
lBeRawPtr<SVGTransform> passNewItem, size_t index, ExceptionState& exceptionStat
e) |
| 391 { |
| 392 RefPtrWillBeRawPtr<SVGTransform> newItem = passNewItem; |
| 393 |
| 394 // SVG2-Draft Spec: If newItem is already in a list, then a new SVGTransform
object is created with the same values as newItem and this item is inserted int
o the list. |
| 395 // Otherwise, newItem itself is inserted into the list. |
| 396 if (newItem->ownerList()) |
| 397 return Base::replaceItem(newItem->clone(), index, exceptionState); |
| 398 |
| 399 return Base::replaceItem(newItem, index, exceptionState); |
| 400 } |
| 401 |
| 402 } |
OLD | NEW |