<?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>20769</bug_id>
          
          <creation_ts>2008-09-10 13:08:16 -0700</creation_ts>
          <short_desc>SVG refresh/redraw problems on scrolled or relative positioned canvas</short_desc>
          <delta_ts>2009-04-17 10:29:46 -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>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>25268</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>GoogleBug, HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>23881</dependson>
    
    <dependson>25224</dependson>
    
    <dependson>25254</dependson>
    
    <dependson>25268</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anthony Glenning">aglenning</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>hyatt</cc>
    
    <cc>oliver</cc>
    
    <cc>pam</cc>
    
    <cc>rwlbuis</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90789</commentid>
    <comment_count>0</comment_count>
    <who name="Anthony Glenning">aglenning</who>
    <bug_when>2008-09-10 13:08:16 -0700</bug_when>
    <thetext>SVG redraw is broken if the canvas is not positioned at the origin. More specifically, I suspect that the calculations to determine the region to refresh do not account for when the SVG canvas is offset. The SVG canvas can be offset either by using scrollbars or by putting it inside a relatively positioned DIV.

In the attached test file, at normal &quot;zoom&quot; you can drag the red square around and everything looks fine. As the square is moved, the canvas is redrawn to remove the old square and draw the square in the new position.

If you select &quot;Zoom Out&quot;, moving the SVG canvas to a relative offset, and drag the square, strange things happen. Usually it appears that the drag has no effect. In reality the square is moved, it is just that the screen is not correctly repainted. You can check this by getting a canvas refresh to happen by again changing the zoom level and seeing the square in the updated position. In addition, the square has a &apos;move&apos; cursor set on it. When you drag and drop the square, you&apos;ll see the move cursor appear where you dropped the square and not where the square is drawn.

Similarly, if you select &quot;Zoom In&quot;, while the scroll bars are at (0,0) the drag works. But if you scroll, the calculated repaint region is apparently off. As a really good example, try scrolling just a little bit, and you can see the repainted region is off by the amount of the scroll.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90790</commentid>
    <comment_count>1</comment_count>
      <attachid>23325</attachid>
    <who name="Anthony Glenning">aglenning</who>
    <bug_when>2008-09-10 13:09:18 -0700</bug_when>
    <thetext>Created attachment 23325
Document illustrating reproducible test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90796</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-09-10 13:35:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/6210760&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108372</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-04 16:58:52 -0800</bug_when>
    <thetext>Yeah, I think we have several dupes of this.  The SVG renderers just don&apos;t know about scrolling.  We need to fix clippedOverflowRectForRepaint to not suck.

Hyatt plans to be in this code soon. If not, I&apos;ll dive in, cause this really should be fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115626</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-03-27 15:31:35 -0700</bug_when>
    <thetext>Google has now launched &quot;Sketchy&quot; (the drawing feature for docs), which hits this bug hard.  I&apos;ve been meaning to fix it for a while, but now it actually effects a shipping product. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116865</commentid>
    <comment_count>5</comment_count>
      <attachid>29329</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-08 05:42:50 -0700</bug_when>
    <thetext>Created attachment 29329
further reduction</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116876</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-08 07:02:14 -0700</bug_when>
    <thetext>I&apos;ve looked at this some over the last two days (in between crash fixing for chromium 2.0) and it looks like the real fix here is to just kill absoluteTransform().

absoluteTransform() is wrong (or at least it&apos;s in conflict with how the rest of the rendering tree works) and doesn&apos;t always account for the full transform.

SVG renders will need different &quot;local&quot; transform methods instead.  (Which don&apos;t need to be virtual, and can just be helpers implemented on each renderer).  All SVG renderers will need one which handles the parentToLocalTransform() (and probably should take passed in tx, ty values?)  and containers will need a separate method to handle localToChildrenTransform() (for things like the viewport transform).

parentToLocalTransform will be applied to the context before all paint calls, including filter painting, clipping, and outline/focus-rect painting.

localToChildrenTransform() will be applied to the context before calling to children to have them paint.

clippedOverflowRectForRepaint will need to be re-written to use overflowRect() and computeRectForRepaint() like the HTML renders use.  I&apos;ll look at this again tomorrow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117525</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-14 14:26:35 -0700</bug_when>
    <thetext>I wrote up a patch to fix this last week.  I&apos;m fixing some related bugs the patch uncovered, and I&apos;ll be posting it shortly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117703</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-15 17:44:03 -0700</bug_when>
    <thetext>I wrote up a fix for this last week, but it depends on about 20 other local git commits I have in my tree.  I&apos;ll be landing those over the next couple days, and then this bug (and bug 14015) will finally be fixed!  (And the SVG rendering tree looks a lot saner as a result)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117815</commentid>
    <comment_count>9</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2009-04-16 15:14:29 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; I wrote up a fix for this last week, but it depends on about 20 other local git
&gt; commits I have in my tree.  I&apos;ll be landing those over the next couple days,
&gt; and then this bug (and bug 14015) will finally be fixed!  (And the SVG
&gt; rendering tree looks a lot saner as a result)

Excellent Eric! I wish I would have some time to help... very promising work!
I can at least help reviewing, if you cc me on the upcoming patches, hopefully we can finally find a sane way to integrate within the standard rendering tree :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117926</commentid>
    <comment_count>10</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-17 10:05:51 -0700</bug_when>
    <thetext>Ha!  Never mind my patch to bug 25268 fixes this!  YAY!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117938</commentid>
    <comment_count>11</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-17 10:29:46 -0700</bug_when>
    <thetext>I guess I&apos;ll just dupe this to bug 25268.  There are still text scroll issues, covered by bug 16188, but I&apos;ll get to those later today. :)

*** This bug has been marked as a duplicate of 25268 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>23325</attachid>
            <date>2008-09-10 13:09:18 -0700</date>
            <delta_ts>2009-04-08 05:43:05 -0700</delta_ts>
            <desc>Document illustrating reproducible test case</desc>
            <filename>test.xml</filename>
            <type>application/xhtml+xml</type>
            <size>2417</size>
            <attacher name="Anthony Glenning">aglenning</attacher>
            
              <data encoding="base64">PGh0bWwgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgo8aGVhZD4KPH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ment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>29329</attachid>
            <date>2009-04-08 05:42:50 -0700</date>
            <delta_ts>2009-04-08 05:42:50 -0700</delta_ts>
            <desc>further reduction</desc>
            <filename>scale.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>1501</size>
            <attacher name="Eric Seidel (no email)">eric</attacher>
            
              <data encoding="base64">PGh0bWwgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgo8Ym9keT4KICA8ZGl2
IHN0eWxlPSJvdmVyZmxvdzogYXV0bzsgd2lkdGg6IDgwMHB4OyBoZWlnaHQ6IDYwMHB4OyBiYWNr
Z3JvdW5kLWNvbG9yOiAjOTk5Ij4KICAgICAgb3V0ZXIgZGl2CiAgICA8ZGl2IGlkPSJpbm5lciIg
c3R5bGU9InBvc2l0aW9uOiByZWxhdGl2ZTsgd2lkdGg6IDQwMHB4OyBoZWlnaHQ6IDMwMHB4OyBs
ZWZ0OiA2MHB4OyB0b3A6IDgwcHg7IGJhY2tncm91bmQtY29sb3I6ICNDQ0MiPgogICAgICAgIGlu
bmVyIGRpdgogICAgICA8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaWQ9
ImNhbnZhcyIgIGhlaWdodD0iMzAwcHgiIHdpZHRoPSI0MDBweCIgcHJlc2VydmVBc3BlY3RSYXRp
bz0ibm9uZSIgdmlld0JveD0iMCAwIDMwMCAyMDAiIG92ZXJmbG93PSJoaWRkZW4iPgogICAgICAg
IDxyZWN0IGlkPSJyZWN0IiB4PSIxMCIgeT0iMTAiIHdpZHRoPSIxMDBweCIgaGVpZ2h0PSIxMDBw
eCIgc3Ryb2tlLXdpZHRoPSI3IiBzdHJva2U9IiMwNzM3NjMiIGZpbGw9InJlZCIgLz4KICAgICAg
PC9zdmc+CiAgICA8L2Rpdj4KICA8L2Rpdj4KICA8c2NyaXB0PgogICAgdmFyIGlubmVyID0gZG9j
dW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MCk7CiAgICB9CiAgICBqaWdnbGUoKTsKICA8L3Njcmlw
dD4KPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>