<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>63911</bug_id>
          
          <creation_ts>2011-07-04 08:22:42 -0700</creation_ts>
          <short_desc>REGRESSION (r89774): svg/W3C-SVG-1.1/animate-elem-82-t.svg hits assertion failure.</short_desc>
          <delta_ts>2011-07-14 09:20:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://dev.w3.org/SVG/profiles/1.1F2/test/svg/animate-elem-82-t.svg</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Young Han Lee">joybro201</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>krit</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>431939</commentid>
    <comment_count>0</comment_count>
    <who name="Young Han Lee">joybro201</who>
    <bug_when>2011-07-04 08:22:42 -0700</bug_when>
    <thetext>ASSERTION FAILED: i &lt; size()
/Users/dirk/Downloads/webkit-trunk/WebKitBuild/Debug/JavaScriptCore.framework/PrivateHeaders/Vector.h(542) : const T&amp; WTF::Vector&lt;T, inlineCapacity&gt;::at(size_t) const [with T = float, long unsigned int inlineCapacity = 0ul]
1   WTF::Vector&lt;float, 0ul&gt;::at(unsigned long) const
2   WTF::Vector&lt;float, 0ul&gt;::operator[](unsigned long) const
3   WebCore::SVGAnimationElement::currentValuesForValuesAnimation(float, float&amp;, WTF::String&amp;, WTF::String&amp;) const
4   WebCore::SVGAnimationElement::updateAnimation(float, unsigned int, WebCore::SVGSMILElement*)
5   WebCore::SVGSMILElement::progress(WebCore::SMILTime, WebCore::SVGSMILElement*)
6   WebCore::SMILTimeContainer::updateAnimations(WebCore::SMILTime, double, WTF::String const&amp;)
7   WebCore::SMILTimeContainer::timerFired(WebCore::Timer&lt;WebCore::SMILTimeContainer&gt;*)
8   WebCore::Timer&lt;WebCore::SMILTimeContainer&gt;::fired()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>431961</commentid>
    <comment_count>1</comment_count>
    <who name="Young Han Lee">joybro201</who>
    <bug_when>2011-07-04 09:30:42 -0700</bug_when>
    <thetext>svg/W3C-SVG-1.1/animate-elem-33-t.svg also hits assertion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>432001</commentid>
    <comment_count>2</comment_count>
      <attachid>99648</attachid>
    <who name="Young Han Lee">joybro201</who>
    <bug_when>2011-07-04 11:32:04 -0700</bug_when>
    <thetext>Created attachment 99648
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>432049</commentid>
    <comment_count>3</comment_count>
      <attachid>99648</attachid>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2011-07-04 13:50:50 -0700</bug_when>
    <thetext>Comment on attachment 99648
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=99648&amp;action=review

This is a regression, so we need a regression test. Can you add a test to svg/animation please? I also have a question to your fix. r- because of the missing test.

&gt; Source/WebCore/svg/SVGAnimationElement.cpp:494
&gt; +    if (percent == 1) {
&gt; +        from = m_values[valuesCount - 1];
&gt; +        to = m_values[valuesCount - 1];
&gt; +        effectivePercent = 1;
&gt; +        return;
&gt; +    }

I just wonder. Here we return always effectivePercent = 1 if percent is 1,...

&gt; Source/WebCore/svg/SVGAnimationElement.cpp:520
&gt;      if (calcMode == CalcModeDiscrete) {
&gt;          if (!keyTimesCount) 
&gt; -            index = percent == 1 ? valuesCount - 1 : static_cast&lt;unsigned&gt;(percent * valuesCount);
&gt; +            index = static_cast&lt;unsigned&gt;(percent * valuesCount);
&gt;          from = m_values[index];
&gt;          to = m_values[index];
&gt;          effectivePercent = 0;

here we return effectivePercent = 0 for discrete animations. Sure that this doesn&apos;t cause new problems?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>432083</commentid>
    <comment_count>4</comment_count>
    <who name="Young Han Lee">joybro201</who>
    <bug_when>2011-07-04 19:01:46 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 99648 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=99648&amp;action=review
&gt; 
&gt; This is a regression, so we need a regression test. Can you add a test to svg/animation please? I also have a question to your fix. r- because of the missing test.

I&apos;m not sure what kind of test could be added in this case because this regression has no symptoms, looks like working correctly, apart from assertion failures, and the assertion failures are not even occurred if the testcase has runAnimationTests() like our testcases in svg/animations.

&gt; 
&gt; &gt; Source/WebCore/svg/SVGAnimationElement.cpp:494
&gt; &gt; +    if (percent == 1) {
&gt; &gt; +        from = m_values[valuesCount - 1];
&gt; &gt; +        to = m_values[valuesCount - 1];
&gt; &gt; +        effectivePercent = 1;
&gt; &gt; +        return;
&gt; &gt; +    }
&gt; 
&gt; I just wonder. Here we return always effectivePercent = 1 if percent is 1,...
&gt; 
&gt; &gt; Source/WebCore/svg/SVGAnimationElement.cpp:520
&gt; &gt;      if (calcMode == CalcModeDiscrete) {
&gt; &gt;          if (!keyTimesCount) 
&gt; &gt; -            index = percent == 1 ? valuesCount - 1 : static_cast&lt;unsigned&gt;(percent * valuesCount);
&gt; &gt; +            index = static_cast&lt;unsigned&gt;(percent * valuesCount);
&gt; &gt;          from = m_values[index];
&gt; &gt;          to = m_values[index];
&gt; &gt;          effectivePercent = 0;
&gt; 
&gt; here we return effectivePercent = 0 for discrete animations. Sure that this doesn&apos;t cause new problems?

Yes, the effectivePercent is meaningful only if the &apos;from&apos; and &apos;to&apos; have different values. I checked that this doesn&apos;t affect the calculation result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>432875</commentid>
    <comment_count>5</comment_count>
    <who name="Young Han Lee">joybro201</who>
    <bug_when>2011-07-06 11:00:55 -0700</bug_when>
    <thetext>On second thoughts, we already have the regression test, svg/W3C-SVG-1.1/animate-elem-82-t.svg, in the LayoutTests!

how about that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>433572</commentid>
    <comment_count>6</comment_count>
      <attachid>99648</attachid>
    <who name="Young Han Lee">joybro201</who>
    <bug_when>2011-07-07 10:21:13 -0700</bug_when>
    <thetext>Comment on attachment 99648
Patch

Dirk, would you review this again?

I believe that this patch doesn&apos;t need another test because of the above-mentioned reasons.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>437122</commentid>
    <comment_count>7</comment_count>
      <attachid>99648</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-07-14 09:20:14 -0700</bug_when>
    <thetext>Comment on attachment 99648
Patch

Clearing flags on attachment: 99648

Committed r91002: &lt;http://trac.webkit.org/changeset/91002&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>437123</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-07-14 09:20:19 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>99648</attachid>
            <date>2011-07-04 11:32:04 -0700</date>
            <delta_ts>2011-07-14 09:20:14 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-63911-20110705033201.patch</filename>
            <type>text/plain</type>
            <size>4132</size>
            <attacher name="Young Han Lee">joybro201</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbj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UGVyY2VudCAtIGZyb21QZXJjZW50KTsKICAgICAKICAgICBpZiAoY2FsY01v
ZGUgPT0gQ2FsY01vZGVTcGxpbmUpIHsKICAgICAgICAgQVNTRVJUKG1fa2V5U3BsaW5lcy5zaXpl
KCkgPT0gbV92YWx1ZXMuc2l6ZSgpIC0gMSk7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>