Changeset 57896 in webkit


Ignore:
Timestamp:
Apr 20, 2010 10:31:43 AM (14 years ago)
Author:
krit@webkit.org
Message:

2010-04-20 Robin Cao <robin.webkit@gmail.com>

Reviewed by Dirk Schulze.

SVG no AnimateColor for stroke or fill if they are set to none on target.
https://bugs.webkit.org/show_bug.cgi?id=36718

SVGAnimateElement::resetToBaseValue reset 'm_propertyType' in the process of animation.
This will cause problems when attributes 'fill' and 'stroke' have the value 'none', because in this case
the property type determined by base value may be different from the one determined by 'fromTo' values.

No new tests. The test suite in svg/animation is not working for target element with attribute 'fill' set to 'none'.
Now animateColor on target element with attributes 'fill' and 'stroke' set to 'none' is possible.

  • svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::resetToBaseValue):

2010-04-20 Robin Cao <robin.webkit@gmail.com>

Reviewed by Dirk Schulze.

Update expected results after bug fix: https://bugs.webkit.org/show_bug.cgi?id=36718
now animateColor on target element with attributes 'fill' and 'stroke' set to 'none' is possible.

  • platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.checksum: Updated.
  • platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.png: Updated.
  • platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.txt: Updated.
  • svg/custom/animation-currentColor.svg: Updated.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r57890 r57896  
     12010-04-20  Robin Cao  <robin.webkit@gmail.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Update expected results after bug fix: https://bugs.webkit.org/show_bug.cgi?id=36718
     6        now animateColor on target element with attributes 'fill' and 'stroke' set to 'none' is possible.
     7
     8        * platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.checksum: Updated.
     9        * platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.png: Updated.
     10        * platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.txt: Updated.
     11        * svg/custom/animation-currentColor.svg: Updated.
     12
    1132010-04-20  Adam Roben  <aroben@apple.com>
    214
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.checksum

    r44224 r57896  
    1 8126480e1fa31f326a9796a8557b6688
     17208c6b68c8a6061da2e9c1a55ca18b9
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.txt

    r54483 r57896  
    7676                RenderPath {rect} at (405,69) size 8x4 [transform={m=((1.00,0.00)(0.00,1.00)) t=(15.00,0.00)}] [fill={[type=SOLID] [color=#E65233]}] [data="M10.00,-6.00 L18.00,-6.00 L18.00,-2.00 L10.00,-2.00 Z"]
    7777                RenderPath {rect} at (420,69) size 8x4 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}] [fill={[type=SOLID] [color=#FFA500]}] [data="M10.00,-6.00 L18.00,-6.00 L18.00,-2.00 L10.00,-2.00 Z"]
    78           RenderPath {rect} at (170,75) size 8x8 [fill={[type=SOLID] [color=#FFA500]}] [data="M10.00,0.00 L18.00,0.00 L18.00,8.00 L10.00,8.00 Z"]
     78          RenderPath {rect} at (170,75) size 8x8 [fill={[type=SOLID] [color=#CC0066]}] [data="M10.00,0.00 L18.00,0.00 L18.00,8.00 L10.00,8.00 Z"]
    7979          RenderSVGContainer {g} at (280,75) size 8x8 [transform={m=((1.00,0.00)(0.00,1.00)) t=(110.00,0.00)}]
    80             RenderPath {rect} at (280,75) size 8x8 [fill={[type=SOLID] [color=#FFA500]}] [data="M10.00,0.00 L18.00,0.00 L18.00,8.00 L10.00,8.00 Z"]
     80            RenderPath {rect} at (280,75) size 8x8 [fill={[type=SOLID] [color=#CC0066]}] [data="M10.00,0.00 L18.00,0.00 L18.00,8.00 L10.00,8.00 Z"]
    8181          RenderSVGContainer {a} at (390,75) size 8x8 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,0.00)}]
    82             RenderPath {rect} at (390,75) size 8x8 [fill={[type=SOLID] [color=#FFA500]}] [data="M10.00,0.00 L18.00,0.00 L18.00,8.00 L10.00,8.00 Z"]
     82            RenderPath {rect} at (390,75) size 8x8 [fill={[type=SOLID] [color=#CC0066]}] [data="M10.00,0.00 L18.00,0.00 L18.00,8.00 L10.00,8.00 Z"]
    8383        RenderSVGContainer {g} at (163,90) size 272x22 [transform={m=((1.00,0.00)(0.00,1.00)) t=(5.00,15.00)}]
    8484          RenderSVGHiddenContainer {defs} at (0,0) size 0x0
  • trunk/LayoutTests/svg/custom/animation-currentColor.svg

    r56775 r57896  
    11<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    22<rect x="10" y="10" width="50" height="50" color="green" fill="red">
    3     <animateColor attributeName="fill" to="currentColor" begin="0s" dur="1s" fill="freeze"/>
     3    <animateColor attributeName="fill" from="green" to="currentColor" begin="0s" dur="1s" fill="freeze"/>
    44</rect>
    55<rect x="60" y="10" width="50" height="50" color="green" fill="red">
  • trunk/WebCore/ChangeLog

    r57895 r57896  
     12010-04-20  Robin Cao  <robin.webkit@gmail.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        SVG no AnimateColor for stroke or fill if they are set to none on target.
     6        https://bugs.webkit.org/show_bug.cgi?id=36718
     7
     8        SVGAnimateElement::resetToBaseValue reset 'm_propertyType' in the process of animation.
     9        This will cause problems when attributes 'fill' and 'stroke' have the value 'none', because in this case
     10        the property type determined by base value may be different from the one determined by 'fromTo' values.
     11
     12        No new tests. The test suite in svg/animation is not working for target element with attribute 'fill' set to 'none'.
     13        Now animateColor on target element with attributes 'fill' and 'stroke' set to 'none' is possible.
     14
     15        * svg/SVGAnimateElement.cpp:
     16        (WebCore::SVGAnimateElement::calculateFromAndToValues):
     17        (WebCore::SVGAnimateElement::resetToBaseValue):
     18
    1192010-04-20  Sheriff Bot  <webkit.review.bot@gmail.com>
    220
  • trunk/WebCore/svg/SVGAnimateElement.cpp

    r56795 r57896  
    179179        m_fromColor = SVGColor::colorFromRGBColorString(fromString);
    180180        m_toColor = SVGColor::colorFromRGBColorString(toString);
    181         if (m_fromColor.isValid() && m_toColor.isValid())
     181        if (m_fromColor.isValid() && m_toColor.isValid() || m_toColor.isValid() && animationMode() == ToAnimation)
    182182            return true;
    183183    } else if (m_propertyType == NumberProperty) {
     
    237237{
    238238    m_animatedString = baseString;
     239    PropertyType lastType = m_propertyType;
    239240    m_propertyType = determinePropertyType(attributeName());
    240241    if (m_propertyType == ColorProperty) {
    241242        m_animatedColor = baseString.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(baseString);
    242         if (m_animatedColor.isValid())
     243        if (isContributing(elapsed())) {
     244            m_propertyType = lastType;
    243245            return;
     246        }
    244247    } else if (m_propertyType == NumberProperty) {
    245248        if (baseString.isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.