| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2007 Rob Buis <buis@kde.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return m_resources.get(id); | 92 return m_resources.get(id); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m
onotonicAnimationStartTime) | 95 void SVGDocumentExtensions::serviceOnAnimationFrame(Document& document, double m
onotonicAnimationStartTime) |
| 96 { | 96 { |
| 97 if (!document.svgExtensions()) | 97 if (!document.svgExtensions()) |
| 98 return; | 98 return; |
| 99 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime
); | 99 document.accessSVGExtensions().serviceAnimations(monotonicAnimationStartTime
); |
| 100 } | 100 } |
| 101 | 101 |
| 102 static bool isSVGAttributeHandle(const PropertyHandle& propertyHandle) |
| 103 { |
| 104 return propertyHandle.isSVGAttribute(); |
| 105 } |
| 106 |
| 102 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime
) | 107 void SVGDocumentExtensions::serviceAnimations(double monotonicAnimationStartTime
) |
| 103 { | 108 { |
| 104 if (RuntimeEnabledFeatures::smilEnabled()) { | 109 if (RuntimeEnabledFeatures::smilEnabled()) { |
| 105 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers; | 110 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers; |
| 106 copyToVector(m_timeContainers, timeContainers); | 111 copyToVector(m_timeContainers, timeContainers); |
| 107 for (const auto& container : timeContainers) | 112 for (const auto& container : timeContainers) |
| 108 container->timeContainer()->serviceAnimations(monotonicAnimationStar
tTime); | 113 container->timeContainer()->serviceAnimations(monotonicAnimationStar
tTime); |
| 109 } | 114 } |
| 110 | 115 |
| 111 SVGElementSet webAnimationsPendingSVGElements; | 116 SVGElementSet webAnimationsPendingSVGElements; |
| 112 webAnimationsPendingSVGElements.swap(m_webAnimationsPendingSVGElements); | 117 webAnimationsPendingSVGElements.swap(m_webAnimationsPendingSVGElements); |
| 113 | 118 |
| 114 // TODO(alancutter): Make SVG animation effect application a separate docume
nt lifecycle phase from servicing animations to be responsive to Javascript mani
pulation of exposed animation objects. | 119 // TODO(alancutter): Make SVG animation effect application a separate docume
nt lifecycle phase from servicing animations to be responsive to Javascript mani
pulation of exposed animation objects. |
| 115 for (auto& svgElement : webAnimationsPendingSVGElements) { | 120 for (auto& svgElement : webAnimationsPendingSVGElements) { |
| 116 ActiveInterpolationsMap activeInterpolationsMap = AnimationStack::active
Interpolations( | 121 ActiveInterpolationsMap activeInterpolationsMap = AnimationStack::active
Interpolations( |
| 117 &svgElement->elementAnimations()->animationStack(), nullptr, nullptr
, KeyframeEffect::DefaultPriority); | 122 &svgElement->elementAnimations()->animationStack(), nullptr, nullptr
, KeyframeEffect::DefaultPriority, isSVGAttributeHandle); |
| 118 for (auto& entry : activeInterpolationsMap) { | 123 for (auto& entry : activeInterpolationsMap) { |
| 119 if (!entry.key.isSVGAttribute()) | |
| 120 continue; | |
| 121 const QualifiedName& attribute = entry.key.svgAttribute(); | 124 const QualifiedName& attribute = entry.key.svgAttribute(); |
| 122 const Interpolation& interpolation = *entry.value.first(); | 125 const Interpolation& interpolation = *entry.value.first(); |
| 123 if (interpolation.isInvalidatableInterpolation()) { | 126 if (interpolation.isInvalidatableInterpolation()) { |
| 124 InterpolationEnvironment environment(*svgElement, svgElement->pr
opertyFromAttribute(attribute)->baseValueBase()); | 127 InterpolationEnvironment environment(*svgElement, svgElement->pr
opertyFromAttribute(attribute)->baseValueBase()); |
| 125 InvalidatableInterpolation::applyStack(entry.value, environment)
; | 128 InvalidatableInterpolation::applyStack(entry.value, environment)
; |
| 126 } else { | 129 } else { |
| 127 // TODO(alancutter): Remove this old code path once animations h
ave completely migrated to InterpolationTypes. | 130 // TODO(alancutter): Remove this old code path once animations h
ave completely migrated to InterpolationTypes. |
| 128 toSVGInterpolation(interpolation).apply(*svgElement); | 131 toSVGInterpolation(interpolation).apply(*svgElement); |
| 129 } | 132 } |
| 130 } | 133 } |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 visitor->trace(m_document); | 397 visitor->trace(m_document); |
| 395 visitor->trace(m_timeContainers); | 398 visitor->trace(m_timeContainers); |
| 396 visitor->trace(m_webAnimationsPendingSVGElements); | 399 visitor->trace(m_webAnimationsPendingSVGElements); |
| 397 visitor->trace(m_relativeLengthSVGRoots); | 400 visitor->trace(m_relativeLengthSVGRoots); |
| 398 visitor->trace(m_pendingResources); | 401 visitor->trace(m_pendingResources); |
| 399 visitor->trace(m_pendingResourcesForRemoval); | 402 visitor->trace(m_pendingResourcesForRemoval); |
| 400 #endif | 403 #endif |
| 401 } | 404 } |
| 402 | 405 |
| 403 } | 406 } |
| OLD | NEW |