Changeset 56775 in webkit
- Timestamp:
- Mar 30, 2010 4:28:55 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r56773 r56775 1 2010-03-30 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVG Animation doesn't respect 'currentColor' 6 https://bugs.webkit.org/show_bug.cgi?id=36695 7 8 Check if SVG animation takes the color value of the target element as 'currentColor'. 9 10 * platform/mac/svg/custom/animation-currentColor-expected.checksum: Added. 11 * platform/mac/svg/custom/animation-currentColor-expected.png: Added. 12 * platform/mac/svg/custom/animation-currentColor-expected.txt: Added. 13 * svg/custom/animation-currentColor.svg: Added. 14 1 15 2010-03-30 Yury Semikhatsky <yurys@chromium.org> 2 16 -
trunk/WebCore/ChangeLog
r56772 r56775 1 2010-03-30 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVG Animation doesn't respect 'currentColor' 6 https://bugs.webkit.org/show_bug.cgi?id=36695 7 8 Test: svg/custom/animation-currentColor.svg 9 10 SVG Animation can't handle currentColor at the moment. This patch catches the 11 color value of the target element and replaces 'currentColor' with it's color string. 12 13 * svg/SVGAnimationElement.cpp: 14 (WebCore::adjustForCurrentColor): 15 (WebCore::SVGAnimationElement::startedActiveInterval): 16 1 17 2010-03-30 Ilya Tikhonovsky <loislo@chromium.org> 2 18 -
trunk/WebCore/svg/SVGAnimationElement.cpp
r56214 r56775 27 27 #include "SVGAnimationElement.h" 28 28 29 #include "Color.h" 29 30 #include "CSSComputedStyleDeclaration.h" 30 31 #include "CSSParser.h" … … 36 37 #include "HTMLNames.h" 37 38 #include "MappedAttribute.h" 39 #include "RenderObject.h" 38 40 #include "SVGElementInstance.h" 39 41 #include "SVGNames.h" … … 469 471 } 470 472 } 473 static inline void adjustForCurrentColor(String& value, SVGElement* target) 474 { 475 if (!target || !target->isStyled() || value != "currentColor") 476 return; 477 478 if (RenderObject* targetRenderer = target->renderer()) 479 value = targetRenderer->style()->color().name(); 480 } 471 481 472 482 void SVGAnimationElement::startedActiveInterval() … … 488 498 } 489 499 500 String from = fromValue(); 501 String to = toValue(); 502 String by = byValue(); 503 SVGElement* target = targetElement(); 490 504 AnimationMode animationMode = this->animationMode(); 491 505 if (animationMode == NoAnimation) 492 506 return; 493 if (animationMode == FromToAnimation) 494 m_animationValid = calculateFromAndToValues(fromValue(), toValue()); 495 else if (animationMode == ToAnimation) { 507 if (animationMode == FromToAnimation) { 508 adjustForCurrentColor(from, target); 509 adjustForCurrentColor(to, target); 510 m_animationValid = calculateFromAndToValues(from, to); 511 } else if (animationMode == ToAnimation) { 496 512 // For to-animations the from value is the current accumulated value from lower priority animations. 497 513 // The value is not static and is determined during the animation. 498 m_animationValid = calculateFromAndToValues(String(), toValue()); 499 } else if (animationMode == FromByAnimation) 500 m_animationValid = calculateFromAndByValues(fromValue(), byValue()); 501 else if (animationMode == ByAnimation) 502 m_animationValid = calculateFromAndByValues(String(), byValue()); 503 else if (animationMode == ValuesAnimation) { 514 adjustForCurrentColor(to, target); 515 m_animationValid = calculateFromAndToValues(String(), to); 516 } else if (animationMode == FromByAnimation) { 517 adjustForCurrentColor(from, target); 518 adjustForCurrentColor(by, target); 519 m_animationValid = calculateFromAndByValues(from, by); 520 } else if (animationMode == ByAnimation) { 521 adjustForCurrentColor(by, target); 522 m_animationValid = calculateFromAndByValues(String(), by); 523 } else if (animationMode == ValuesAnimation) { 504 524 m_animationValid = m_values.size() > 1 505 525 && (calcMode == CalcModePaced || !hasAttribute(SVGNames::keyTimesAttr) || hasAttribute(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size()))
Note: See TracChangeset
for help on using the changeset viewer.