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

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

Issue 896773002: [svg2] Make 'x' and 'y' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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 | « Source/core/svg/SVGAnimationElement.h ('k') | Source/core/svg/SVGElement.h » ('j') | 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 { 361 {
362 DEFINE_STATIC_LOCAL(const AtomicString, sum, ("sum", AtomicString::Construct FromLiteral)); 362 DEFINE_STATIC_LOCAL(const AtomicString, sum, ("sum", AtomicString::Construct FromLiteral));
363 const AtomicString& value = fastGetAttribute(SVGNames::accumulateAttr); 363 const AtomicString& value = fastGetAttribute(SVGNames::accumulateAttr);
364 return value == sum && animationMode() != ToAnimation; 364 return value == sum && animationMode() != ToAnimation;
365 } 365 }
366 366
367 bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement , const QualifiedName& attributeName) 367 bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement , const QualifiedName& attributeName)
368 { 368 {
369 ASSERT(targetElement); 369 ASSERT(targetElement);
370 370
371 return SVGElement::isAnimatableCSSProperty(attributeName); 371 return SVGElement::isAnimatableCSSProperty(attributeName) || targetElement-> isPresentationAttribute(attributeName);
372 } 372 }
373 373
374 SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimat ion(SVGElement* targetElement, const QualifiedName& attributeName) 374 SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimat ion(SVGElement* targetElement, const QualifiedName& attributeName)
375 { 375 {
376 if (!hasValidAttributeType() || !targetElement || attributeName == anyQName( ) || !targetElement->inActiveDocument()) 376 if (!hasValidAttributeType() || !targetElement || attributeName == anyQName( ) || !targetElement->inActiveDocument())
377 return DontApplyAnimation; 377 return DontApplyAnimation;
378 378
379 // Always animate CSS properties, using the ApplyCSSAnimation code path, reg ardless of the attributeType value. 379 // Always animate CSS properties, using the ApplyCSSAnimation code path, reg ardless of the attributeType value.
380 if (isTargetAttributeCSSProperty(targetElement, attributeName)) 380 if (isTargetAttributeCSSProperty(targetElement, attributeName)) {
381 if (targetElement->isPresentationAttributeWithSVGDOM(attributeName))
382 return ApplyXMLandCSSAnimation;
383
381 return ApplyCSSAnimation; 384 return ApplyCSSAnimation;
382 385 }
383 // If attributeType="CSS" and attributeName doesn't point to a CSS property, ignore the animation. 386 // If attributeType="CSS" and attributeName doesn't point to a CSS property, ignore the animation.
384 if (attributeType() == AttributeTypeCSS) 387 if (attributeType() == AttributeTypeCSS)
385 return DontApplyAnimation; 388 return DontApplyAnimation;
386 389
387 return ApplyXMLAnimation; 390 return ApplyXMLAnimation;
388 } 391 }
389 392
390 void SVGAnimationElement::calculateKeyTimesForCalcModePaced() 393 void SVGAnimationElement::calculateKeyTimesForCalcModePaced()
391 { 394 {
392 ASSERT(calcMode() == CalcModePaced); 395 ASSERT(calcMode() == CalcModePaced);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 SVGSMILElement::setAttributeName(attributeName); 714 SVGSMILElement::setAttributeName(attributeName);
712 checkInvalidCSSAttributeType(targetElement()); 715 checkInvalidCSSAttributeType(targetElement());
713 } 716 }
714 717
715 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) 718 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
716 { 719 {
717 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me()); 720 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me());
718 } 721 }
719 722
720 } 723 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAnimationElement.h ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698