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

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

Issue 2394583002: Move shouldApplyAnimation to SVGAnimateElement (Closed)
Patch Set: Created 4 years, 2 months 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
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimationElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 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) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 350
351 bool SVGAnimationElement::isTargetAttributeCSSProperty( 351 bool SVGAnimationElement::isTargetAttributeCSSProperty(
352 SVGElement* targetElement, 352 SVGElement* targetElement,
353 const QualifiedName& attributeName) { 353 const QualifiedName& attributeName) {
354 ASSERT(targetElement); 354 ASSERT(targetElement);
355 355
356 return SVGElement::isAnimatableCSSProperty(attributeName) || 356 return SVGElement::isAnimatableCSSProperty(attributeName) ||
357 targetElement->isPresentationAttribute(attributeName); 357 targetElement->isPresentationAttribute(attributeName);
358 } 358 }
359 359
360 SVGAnimationElement::ShouldApplyAnimationType
361 SVGAnimationElement::shouldApplyAnimation(SVGElement* targetElement,
362 const QualifiedName& attributeName) {
363 if (!hasValidAttributeType() || attributeName == anyQName() ||
364 !targetElement || !targetElement->inActiveDocument() ||
365 !targetElement->parentNode())
366 return DontApplyAnimation;
367
368 // Always animate CSS properties using the ApplyCSSAnimation code path,
369 // regardless of the attributeType value.
370 if (isTargetAttributeCSSProperty(targetElement, attributeName)) {
371 if (targetElement->isPresentationAttributeWithSVGDOM(attributeName))
372 return ApplyXMLandCSSAnimation;
373
374 return ApplyCSSAnimation;
375 }
376 // If attributeType="CSS" and attributeName doesn't point to a CSS property,
377 // ignore the animation.
378 if (getAttributeType() == AttributeTypeCSS)
379 return DontApplyAnimation;
380
381 return ApplyXMLAnimation;
382 }
383
384 void SVGAnimationElement::calculateKeyTimesForCalcModePaced() { 360 void SVGAnimationElement::calculateKeyTimesForCalcModePaced() {
385 ASSERT(getCalcMode() == CalcModePaced); 361 ASSERT(getCalcMode() == CalcModePaced);
386 ASSERT(getAnimationMode() == ValuesAnimation); 362 ASSERT(getAnimationMode() == ValuesAnimation);
387 363
388 unsigned valuesCount = m_values.size(); 364 unsigned valuesCount = m_values.size();
389 ASSERT(valuesCount >= 1); 365 ASSERT(valuesCount >= 1);
390 if (valuesCount == 1) 366 if (valuesCount == 1)
391 return; 367 return;
392 368
393 // FIXME, webkit.org/b/109010: m_keyTimes should not be modified in this 369 // FIXME, webkit.org/b/109010: m_keyTimes should not be modified in this
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 if (!hasInvalidCSSAttributeType) 682 if (!hasInvalidCSSAttributeType)
707 schedule(); 683 schedule();
708 } 684 }
709 685
710 // Clear values that may depend on the previous target. 686 // Clear values that may depend on the previous target.
711 if (targetElement()) 687 if (targetElement())
712 clearAnimatedType(); 688 clearAnimatedType();
713 } 689 }
714 690
715 } // namespace blink 691 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimationElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698