<?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>18779</bug_id>
          
          <creation_ts>2008-04-28 02:45:14 -0700</creation_ts>
          <short_desc>REGRESSION(31916-31981): CanvasRenderingContext2D::drawImage no longer respects the srcRect</short_desc>
          <delta_ts>2008-04-28 11:18:48 -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>DOM</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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oliver Hunt">oliver</reporter>
          <assigned_to name="Dave Hyatt">hyatt</assigned_to>
          <cc>hyatt</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79103</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2008-04-28 02:45:14 -0700</bug_when>
    <thetext>While trying to find the cause of another bug i found that we no longer drawImage correctly in the Canvas

The issue appears to be that we no longer respect the srcRect (or at least not correctly)

My money&apos;s on http://trac.webkit.org/changeset/31961</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79104</commentid>
    <comment_count>1</comment_count>
      <attachid>20863</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2008-04-28 02:50:49 -0700</bug_when>
    <thetext>Created attachment 20863
Test case

This test case uses two canvases, in the invisible rect it draws a green square on a red background.  It then draws the portion of that canvas into the other canvas, scaled to fill the entire canvas.  In r31916 and before this works correctly, now the resultant image is a scaled down copy almost as though dst and src rects were reversed, although a quick tour down debugging lane would seem to imply that that is not the case.  In fact it would appear that it may be Image::draw that is not handling the scaling correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79147</commentid>
    <comment_count>2</comment_count>
      <attachid>20871</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-04-28 10:42:30 -0700</bug_when>
    <thetext>Created attachment 20871
Fix the argument reversal.

Will land test case from bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79154</commentid>
    <comment_count>3</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-04-28 11:18:48 -0700</bug_when>
    <thetext>Fixed in r32651.
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>20863</attachid>
            <date>2008-04-28 02:50:49 -0700</date>
            <delta_ts>2008-04-28 02:50:49 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>canvas-test.html</filename>
            <type>text/html</type>
            <size>588</size>
            <attacher name="Oliver Hunt">oliver</attacher>
            
              <data encoding="base64">SWYgdGhpcyByZW5kZXJzIGNvcnJlY3RseSB5b3Ugc2hvdWxkIHNlZSBvbmUgYmlnIGZyaWVuZGx5
IGdyZWVuIHNxdWFyZS4KPGNhbnZhcyBpZD0iY2FudmFzIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIw
MCIgPjwvY2FudmFzPgo8Y2FudmFzIGlkPSJjYW52YXMyIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIw
MCIgc3R5bGU9ImRpc3BsYXk6bm9uZSIgPjwvY2FudmFzPgo8c2NyaXB0Pgp2YXIgY2FudmFzID0g
ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNhbnZhcyIpOwp2YXIgY2FudmFzMiA9IGRvY3VtZW50
LmdldEVsZW1lbnRCeUlkKCJjYW52YXMyIik7CnZhciBjb250ZXh0ID0gY2FudmFzLmdldENvbnRl
eHQoIjJkIik7CnZhciBjb250ZXh0MiA9IGNhbnZhczIuZ2V0Q29udGV4dCgiMmQiKTsKY29udGV4
dDIuZmlsbFN0eWxlID0gJ3JlZCc7CmNvbnRleHQyLmZpbGxSZWN0KDAsMCwyMDAsMjAwKTsKY29u
dGV4dDIuZmlsbFN0eWxlID0gJ2dyZWVuJzsKY29udGV4dDIuZmlsbFJlY3QoNTAsNTAsMTAwLDEw
MCk7CmNvbnRleHQuZHJhd0ltYWdlKGNhbnZhczIsIDUwLCA1MCwgMTAwLCAxMDAsIDAsIDAsIDIw
MCwgMjAwKTsKPC9zY3JpcHQ+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>20871</attachid>
            <date>2008-04-28 10:42:30 -0700</date>
            <delta_ts>2008-04-28 10:48:52 -0700</delta_ts>
            <desc>Fix the argument reversal.</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>554</size>
            <attacher name="Dave Hyatt">hyatt</attacher>
            
              <data encoding="base64">SW5kZXg6IGh0bWwvQ2FudmFzUmVuZGVyaW5nQ29udGV4dDJELmNwcAo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBo
dG1sL0NhbnZhc1JlbmRlcmluZ0NvbnRleHQyRC5jcHAJKHJldmlzaW9uIDMyNDA2KQorKysgaHRt
bC9DYW52YXNSZW5kZXJpbmdDb250ZXh0MkQuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC05OTcsNyAr
OTk3LDcgQEAgdm9pZCBDYW52YXNSZW5kZXJpbmdDb250ZXh0MkQ6OmRyYXdJbWFnZQogICAgICAg
ICBtX2NhbnZhcy0+c2V0T3JpZ2luVGFpbnRlZCgpOwogCiAgICAgd2lsbERyYXcoZGVzdFJlY3Qp
OwotICAgIGMtPmRyYXdJbWFnZShidWZmZXItPmltYWdlKCksIHNvdXJjZVJlY3QsIGRlc3RSZWN0
KTsKKyAgICBjLT5kcmF3SW1hZ2UoYnVmZmVyLT5pbWFnZSgpLCBkZXN0UmVjdCwgc291cmNlUmVj
dCk7CiB9CiAKIC8vIEZJWE1FOiBXaHkgaXNuJ3QgdGhpcyBqdXN0IGFub3RoZXIgb3ZlcmxvYWQg
b2YgZHJhd0ltYWdlPyBXaHkgaGF2ZSBhIGRpZmZlcmVudCBuYW1lPwo=
</data>
<flag name="review"
          id="9130"
          type_id="1"
          status="+"
          setter="timothy"
    />
          </attachment>
      

    </bug>

</bugzilla>