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

Side by Side Diff: Source/WebCore/svg/animation/SVGSMILElement.cpp

Issue 9569016: Merge 108134 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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/WebCore/svg/animation/SVGSMILElement.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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 506
507 SVGElement* SVGSMILElement::targetElement() 507 SVGElement* SVGSMILElement::targetElement()
508 { 508 {
509 if (m_targetElement) 509 if (m_targetElement)
510 return m_targetElement; 510 return m_targetElement;
511 511
512 String href = xlinkHref(); 512 String href = xlinkHref();
513 ContainerNode* target = href.isEmpty() ? parentNode() : SVGURIReference::tar getElementFromIRIString(href, document()); 513 ContainerNode* target = href.isEmpty() ? parentNode() : SVGURIReference::tar getElementFromIRIString(href, document());
514 if (!target || !target->isSVGElement()) 514 if (!target || !target->isSVGElement())
515 return 0; 515 return 0;
516 516
517 m_targetElement = static_cast<SVGElement*>(target); 517 m_targetElement = static_cast<SVGElement*>(target);
518 document()->accessSVGExtensions()->addAnimationElementToTarget(this, m_targe tElement); 518 document()->accessSVGExtensions()->addAnimationElementToTarget(this, m_targe tElement);
519
520 targetElementDidChange(m_targetElement);
521
519 return m_targetElement; 522 return m_targetElement;
520 } 523 }
521 524
522 SMILTime SVGSMILElement::elapsed() const 525 void SVGSMILElement::resetTargetElement()
526 {
527 m_targetElement = 0;
528
529 // Force the animation to recompute values that are only calculated when an animation becomes active.
530 // Failing to do this means that a target reset and change during active ani mation may result in
531 // invalid state.
532 m_activeState = Inactive;
533
534 targetElementDidChange(0);
535 }
536
537 SMILTime SVGSMILElement::elapsed() const
523 { 538 {
524 return m_timeContainer ? m_timeContainer->elapsed() : 0; 539 return m_timeContainer ? m_timeContainer->elapsed() : 0;
525 } 540 }
526 541
527 bool SVGSMILElement::isInactive() const 542 bool SVGSMILElement::isInactive() const
528 { 543 {
529 return m_activeState == Inactive; 544 return m_activeState == Inactive;
530 } 545 }
531 546
532 bool SVGSMILElement::isFrozen() const 547 bool SVGSMILElement::isFrozen() const
533 { 548 {
534 return m_activeState == Frozen; 549 return m_activeState == Frozen;
535 } 550 }
536 551
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 1053
1039 void SVGSMILElement::beginByLinkActivation() 1054 void SVGSMILElement::beginByLinkActivation()
1040 { 1055 {
1041 SMILTime elapsed = this->elapsed(); 1056 SMILTime elapsed = this->elapsed();
1042 addBeginTime(elapsed, elapsed); 1057 addBeginTime(elapsed, elapsed);
1043 } 1058 }
1044 1059
1045 } 1060 }
1046 1061
1047 #endif 1062 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698